Can I set arrays in QDK library?

cangelo
21 Jul 2007, 14:14


!QDK

object <test>
property <testArray[1]; testArray[1];text>
property <testArray[2]; testArray[2];text>


I then put strings "test 1" and "test 2" in the QDK text boxes now available for that library.

If I now toggle code view, those properties show up in the object property list.

However, when I run the game I can't see the array items or even the array name in the object debugger for the given object. Am I doing something wrong or is this not possible?

cangelo
22 Jul 2007, 00:41
I must have missed something as it appears to be defined now, BUT I'm having problems using the $ubound$ function.

msg <array[1] #(cRealObj):testArray[1]#>
msg <array[9] #(cRealObj):testArray[9]#>
msg <array total? $ubound(#(cRealObj):testArray#)$>

I have tried quite a few different ways to get it to recognize testArray (probably because it is a property of an object). It prints <ERROR>.

Freak
22 Jul 2007, 02:14
IIUC, Quest only really recognizes arrays when they are globals; so you can't use ubound or such with "array properties".

paul_one
23 Jul 2007, 10:22
Yeah, properties cann't be interpreted as arrays.

Also, properties are formatted more like:
object <test>
property < BOOLEAN_PROPERTY; NOT BOOLEAN PROPERTY; PROPERTY=VALUE; PROPERTY=VALUE WITH SPACES UNTIL SEMI-COLON OR END OF PROPERTY LINE>


I like to keep property array upper-bounds in the 0 value:
object <test>
property <array[0]=5;array[1]=num1;array[2]=num2;array[3]=num3;array[4]=num4;array[5]=num5>