String as a command

BlitzPlus Forums/BlitzPlus Programming/String as a command

Parcival(Posted 2007) [#1]
Consider the following situation: There is a string containing a comand, e.g. "A = B". How can I make BB executing the comand if the string itself is a variable?

I hope you understand what I mean...


Beaker(Posted 2007) [#2]
You could convert this:
Evaluate String Arithmetic
or use this might work..
Quick Math Evaluator
or take a look at BVM


Parcival(Posted 2007) [#3]
Well, the comand could also be more complicated like "if A then B", everything you could think off. I am interested in a more general solution to this.


Beaker(Posted 2007) [#4]
Then use BVM.


Senzak(Posted 2007) [#5]
u could write the string to a file and then use Include


Beaker(Posted 2007) [#6]
That wouldn't work, because you can only include a file at compile time.


DjBigWorm(Posted 2007) [#7]
Hi,
Let me know if I am off base. I understand what you want blitz to do, the problem is that it is a compile then run language. It will not accept a command string you will have to look at an interpreter type language. I am not familiar with bvm, that might do what you want. I had the same idea once upon a time then I created a "Sub Language" to talk to blitz. I used the text commands and made my own parsing code and that allowed me to make my graphics seem to have a mind of there own and access the stuff blitz does using my own strings. The commands I made up were not pretty, but practical. For Example, my command look like "[CS1,1]". This command in particular made a sound play out of slot 1. That is all.