Hi Everybody
This is an example code in Liberty basic :
input "Type a numeric expression>"; code$
answer = eval(code$)
print answer
For instance If I type 5+5
I'll get 10
How to do this in Purebasic ?
I found nothing in PB 5.60 help section.
I need this badly
String evalution
Re: String evalution
You can't in native, use liberty basic.
Last edited by Fig on Fri Apr 21, 2017 1:51 pm, edited 2 times in total.
There are 2 methods to program bugless.
But only the third works fine.
Win10, Pb x64 5.71 LTS
But only the third works fine.
Win10, Pb x64 5.71 LTS
Re: String evalution
I don't believe PureBasic has a built-in expression evaluator. Here's one by utopiomania, among others:hessu wrote:Code: Select all
answer = eval(code$)
> Expression evaluator
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
Re: String evalution
Hygge
Re: String evalution
in your case I suggest http://www.purebasic.fr/english/viewtop ... hilit=eval, download link on last post