so when I try to assign the value of an array element to a variable, it won't do it, leaving the variable unchanged. I'm sure there's probably some esoteric way to go about it, but I don't know it and can't seem to find it in the documentation. For example, if I do:
holdervar=MyArray[0];
this won't assign the value of MyArray[0] to holdervar, but leaves holdervar with its original value, regardless if it is a string or an integer. However, I am able to read out of MyArray[0] perfectly using the various functions that come with RealityFactory such as the ShowText function among others. In this vein, I've used this ability to form a work around that is almost perfectly functional, except that it converts everything into a string:
holdervar = "" # MyArray[0];
Because functions like the concatenate function (#) can read MyArray[0] this works but clearly converts holdervar into a string. A further workaround of course is to use the Integer() function to convert back when necessary but when I don't know what type of value to expect this fails.
Any help on this problem would be greatly appreciated!
Array Problems :(
Re: Array Problems :(
I noticed the same error, but I think it happens only sometimes. I think it's due to the parser loop. Probably your variable assign is a one-shot order or statement?
Could you please post ann excerpt of your code?
To avoid the problem, and if the values are positive, i sometimes use the absFloat command...
Could you please post ann excerpt of your code?
To avoid the problem, and if the values are positive, i sometimes use the absFloat command...
Re: Array Problems :(
It's just a simple loop which runs every frame (for now, it won't run every frame once I go back and optimize it to run only when values are actually changed )
The loop above is inside a switch statement, which is inside an if statement, which is inside another loop (with the index i) and that is inside the order ItemShow(), which is called every frame that the menu is open from the main RunPlayer order.
Ah yes, absFloat is another great idea for non-strings! And maybe the Integer() command will also work for negative integers, which just leaves negative floats, but since I don't plan to use them right now, I should be ok
Code: Select all
while (j < numEntriesPerItem)
{
ItemOnDisplayLeft_Array[displayIndex+j]= Item_Array[(i+j)];
j=Integer(j+1);
}
Ah yes, absFloat is another great idea for non-strings! And maybe the Integer() command will also work for negative integers, which just leaves negative floats, but since I don't plan to use them right now, I should be ok