Axe Software Forums
  Quest Developer Forum
  Variables in Variables


Author Topic:   Variables in Variables
Wizard posted 28-06-2001 22:49 GMT     
I have a need for arrays. I think I can simulate it by concatenating an index onto a variable name.

In order for this to work I will need to assign the name of a variable to another variable and still be able to reference the original value.

My question is, what is the syntax to return the original value?

EXAMPLE:

John1=�Hello World�
Sam=�John1�

What is the syntax to get Sam to return �Hello World�?

Wizard

Alex posted 29-06-2001 12:20 GMT          
There is absolutely no way that what you are proposing would be possible in Quest 2.x. Sorry.

Quest 3.0, however, supports arrays already. Check it out now - http://www.axeuk.com/quest/beta .

Computer Whizz posted 29-06-2001 21:06 GMT          
OK. I don't think this is TOTALLY right, and I don't know what use it could be but here you are!

instead of using =, you will have to use ;
so it'll be something like:

set string, or set variable (can't be bothered to lift up the paper book I've got stashed under this very desk :)).
set string John1; hello world
set string/var Sam; #John1#
I'm not totally sure, as I don't really like coding by hand. I'll do the odd bits, but after my printer stoped printing yellow some of the page indexes for the ASL 284 didn't come out..... but that's my problem, and not the question at hand.
There is a part in ASL 284 (Q3) where you can set up array's for later use, just get Quest 3 now, or wait for the new release with QDK3.0 to be released. I don't know how long the later will take but I'm sure it'll be out within the next few months.... judging from his posts recently he's suddenly got alot more time, ergo more development which equals a much mappier me :P
See ya Alex,

--CW
.... oh, yeah I *do* know that set variable is in Q3. Because there's some incompatibility problem with this from ASL 200 to 284 or something like that!

Alex posted 29-06-2001 23:26 GMT          
quote:
set string John1; hello world
set string/var Sam; #John1#

Well yes, that works (if you get the correct syntax anyway), but there's no convenient way to progmatically change the "1" which is the array index. Which renders the whole thing rather pointless.

Wizard posted 02-07-2001 22:16 GMT          
Thank you for replying, I am using 3.0 now and arrys work just fine.

As a result I have now coded buying and selling, wearing and equiping, RPG stats and a method for doing battle.

Its looking good!

Thanks again, Wizard