Article ID: 190491
Article Last Modified on 12/11/1999
Clear
DEBUG
_SCREEN.Show()
DEBUGOUT " "
DEBUGOUT " "
oform1=NEWOBJECT("form1")
DEBUGOUT " "
oform1.PrintToScreen && Output contents of array to screen
=adel(oform1.atest,2) && Deletes 2nd row
DIME oform1.atest[alen(oform1.atest,1)-1,alen(oform1.atest,2)]
DEBUGOUT " "
oform1.PrintToScreen
DIME oform1.atest[alen(oform1.atest,1)+1,alen(oform1.atest,2)]
=ains(oform1.atest,2) && insert before 2nd row
DEBUGOUT " "
oform1.PrintToScreen
DEFINE CLASS form1 AS form
Caption = "Form1"
Name = "Form1"
DIMENSION atest[3,2]
PROCEDURE atest_access
LPARAMETERS m.nIndex1,m.nIndex2
* Echo current program and calling program to
* Debug Output window
DEBUGOUT "In " + PROGRAM()+", called from " ;
+ PROGRAM(PROGRAM(-1)-1)
RETURN THIS.atest[m.nIndex1,m.nIndex2]
ENDPROC
PROCEDURE atest_assign
LPARAMETERS vNewVal,m.nIndex1,m.nIndex2
* Echo current PROGRAM and calling PROGRAM to
* Debug Output window
DEBUGOUT "In "+PROGRAM()+", called from " ;
+ PROGRAM(PROGRAM(-1)-1)
this.atest[m.nIndex1,m.nIndex2] = m.vNewVal
ENDPROC
PROC PrintToScreen
?' Column 1 Column 2'
* Iterate through array and print each element
FOR lnRow = 1 to alen(this.atest, 1)
?
FOR lnCol = 1 to alen(this.atest, 2)
??this.atest[lnRow, lnCol]
ENDFOR
ENDFOR
?
PROCEDURE Load
* Populate the array
FOR lnRow = 1 to alen(this.atest, 1)
FOR lnCol = 1 to alen(this.atest, 2)
this.atest[lnRow, lnCol] = 100 * lnRow + lnCol
ENDFOR
ENDFOR
ENDPROC
ENDDEFINE
Additional query words: kbVFp600 kbOOP
Keywords: kbprb kbcode KB190491