Dimensioned Array (OpenInsight 32-Bit)
At 08 JUN 2006 12:26:48PM Steve Botes wrote:
I am converting some pick code to run with OI. I have run into some problems using matrixs. Perhaps someone can help me with how to do two things.
One, I would like to take a single element from the array XML.TREE and put it in a variable. I have tried the following
temp=XML.TREE(1)
temp=XML.TREE(1,1)
temp=mat XML.TREE(1,1) and various other combinations.
Two is using it in a locate statement.
LOCATE ROOT.ELEMENT in XML.TREE(1) Setting POS THENLOCATE "statusCode" in XML.TREE(3) Setting S.POS ELSES.POS=-1EndSTATUS.CODE=XML.TREE(4) + 0END ELSESTATUS.CODE=0ENDYes, the array was dimmed at the beginning of the program and I have put data into it.
Any pointers on what I might be doing wrong would be appreciated. Even the compiler is confused. It is returning unknow errors on this.
At 08 JUN 2006 12:27PM Steve Botes wrote:
Dim statement
DIM XML.TREE(5, 10)MAT XML.TREE="
At 08 JUN 2006 12:40PM [email protected] wrote:
according to your second post you are creating a 2 dim array but in several places you are looking at the array as a single dimension .. this wont work.
dim xml.tree(5,10)
mat xml.tree=NULL$
line1=this is a test'
convert ' ' to @fm in line1
xml.tree(1,1)=line1
** temp=XML.TREE(1) .. not possible you are creating 2dim array
temp=XML.TREE(1,1) ;* this should equal line 1
At this point 'temp' will be the same a line1. if you wanted to parse the fm delim list ..
cnt=dcount(xml.tree(1,1),@fm)
for pntr=1 to cnt
fld=xml.tree(1,1).. do something ..next pntr
At 08 JUN 2006 03:57PM Warren Auyong wrote:
How are you filling the matrix to begin with? And what sort of data are you putting in the matrix?
Locate only works on dynamic arrays (data with field delimiters) and not on dimensioned arrays, although each "cell" of a dimensioned array can contain dynamic arrays. Sig's example should clarify this.
At 12 JUN 2006 04:24PM Steve Botes wrote:
Thanks everyone. Looks like I have things figured out for now..
At 13 JUN 2006 11:01AM [email protected] wrote:
I have been working on a PICK to OI conversion for quite a while (well off and on). It is very challenging.
I will say that CTO really removes a lot of the road blocks for simple move. Then as the users feel a little more comfortable moving bits over to "OI" becomes easier.
What bryan has done with CTO is, to me, "Simply Marvellous Darling". Being in a OI MDI frame then calling a CTO window (using the great OLE control) and then back to *OI* .. really which I had had CTO at this state 6-8 months ago ..
The only really gotcha that I have found is Picks use of commons and the stupid people who decided that commons couldn't be done in OI .. probably the same who said it could be 32 bit