View Single Post
  #17  
Old 06-01-2006, 11:14 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Omini
ApothiX, he's trying to be helpful. True it's not related to the topic - but if you havn't realized, the problem has been solved. No problem trying to help. :P
Well, it extends off-topic, but isn't entirely off-topic. It's just small useful bits of information to know, and knowing that strings convert to floats when performing math operations on them is good to know. This is probably one of the main reasons @ is used for concatenation rather than +.
I didn't touch on everything however.
One way to test that a string is being converted to a float
temp.string = "10";
temp.string.type(); //should return the num value signifying string
temp.string += 2;
temp.string.type(); //should return the num value signifying float

(Look at Script Functions : Client : TGraalVar for the num values)

Of course, when passing by value in a function, Graal already knows the datatypes that go in a function unless they're user-defined, in which case they are interpreted the same as the rest of the scripting language within the function.
Reply With Quote