Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two-dimensional array - help

Status
Not open for further replies.

PBREP

MIS
Mar 14, 2003
75
US
Hello all:

OK here's the scoop... Maybe you know another way (ref. Purpose)?

Thanks,
~PM

PS - Happy Thanksgiving!

PURPOSE:I mapped a field (via ODBC) from MS Access called Ship_Via to my SA_CUS[1] array.
From there I am attempting to create a procedure that will call/view the information from the SA_CUST[1](memory array)into my SelectorForm.

&& Code
Procedure SelectorForm()
back_to=SELECT() && current work area

oForm = createobject('SelectorForm')
oForm.Show

Define class SelectorForm as Form
DataSession = 2 && Private data session
Caption='Shipping Instructions'
ControlBox= .f.
BorderStyle=1
Height=300
Width=200
WindowType=1
Add object SelectorListBox as listbox with ;
Left=0, Top=0,Height=300,Width=200

&& getting a syntax error, maybe the incorrect way of &&integrating code??


local lnlenlnlen = alen(sa_cust)
dimension sa_cust[lnlen,1]

&& attempting to redimension it to a two-dimensional array.
select lstcsnum
append from array sa_cust

&& attempting to create multiple records, one for each &&array row.

Procedure SelectorListBox.Init()

WITH THIS
.ROWSOURCETYPE = 3
.ROWSOURCE = 'SA_CUST[1] into cursor lstCsnum'
.COLUMNCOUNT=1
.COLUMNLINES = .T.
.COLUMNWIDTHS = '75
ENDWITH
ENDPROC
Thisform.release()

Endproc
Enddefine
 
No compile errors, now need to test.

Procedure SelectorForm()
back_to=SELECT() && curretn work area

oForm = createobject('SelectorForm')
oForm.Show

Define class SelectorForm as Form
DataSession = 2 && Private data session
Caption='Shipping Instructions'
ControlBox= .f.
BorderStyle=1
Height=300
Width=200
WindowType=1
Add object SelectorListBox as listbox with ;
Left=0, Top=0,Height=300,Width=200

Procedure SelectorListBox.Init()
local lnlen
lnlen = alen(sa_cust)
dimension sa_cust[lnlen,1]
select lstcsnum
append from array sa_cust

WITH THIS
.ROWSOURCETYPE = 3
.ROWSOURCE = 'SA_CUST[1] into cursor lstCsnum'
.COLUMNCOUNT=1
.COLUMNLINES = .T.
.COLUMNWIDTHS = 75
ENDWITH
ENDPROC

Enddefine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top