Variables

Blitz3D Forums/Blitz3D Programming/Variables

Skurcey(Posted 2004) [#1]
Is there a way to create variables like this:
"Hello"+var$="Point1"

or do the same thing with types.
var$.varType=new type

or is there a way to create arrays in functions?

and the last for now how to INCLUDE some functions?


soja(Posted 2004) [#2]
"Hello"+var$="Point1"

No. Variable names do not exist at run time, and variable values do not exist until then. You should probably use an array.


or is there a way to create arrays in functions?

You can create a local array (inside a function) like this:
Local myarray%[10]
You can use them inside custom types too. They are known informally as "Blitz Arrays". But technically you don't need them (unless you want them in custom types), because the normal (Dim ..()) arrays are global.


and the last for now how to INCLUDE some functions?

Use the Include statement. Write your functions in a text file (like "Functions.bb") and then say
Include "functions.bb"



Skurcey(Posted 2004) [#3]
how disapointed 'bout that one...


Koriolis(Posted 2004) [#4]
If you really need this then you can use SetEnv & GetEnv
http://www.blitzbasic.com/b3ddocs/command.php?name=setenv&ref=goto
http://www.blitzbasic.com/b3ddocs/command.php?name=getenv&ref=goto
they're close enough to what you want.
But that is, of course, far slower than plain variables (not to say less convenient and more error prone).


Skurcey(Posted 2004) [#5]
thanks...