Wiki Home

Variable In Array


Namespace: WIN_COM_API
I am using VFP 7 and I'm new to a lot of this, so please be gentle.

I am trying to pull an undecided amount of records out of a single table. These records are decided on by the contents of a textbox. The problem comes in when I try to add a variable to the COPY TO line. I also have no clue how to make an array fit a varying amount of records.

*** search by gstnum, pull up all related files, sort selected files by date and use the most recent.

PUBLIC x
m.gstnum = x
LOCAL ARRAY REDRUM[3,3]


SELECT table1
COPY TO ARRAY REDRUM FOR gstnum = x

SELECT temp1
APPEND FROM ARRAY REDRUM

SELECT temp1
SET ORDER TO 1   && ARRIVAL
IF EOF()
GO TOP
ENDIF
SCATTER MEMVAR
rsvnum = m.rsvnum
arrival = m.arrival
DELETE ALL
REINDEX

thisform.refresh


any insight into this would be grealy appreciated.

select table1

select * from table1 ;
  where table1.gstnum = m.gstnum ;
  order by arrival descending ;
  into cursor REDRUM

select REDRUM
go top
browse


works like a charm, thank you very much.
( Topic last updated: 2008.02.20 10:31:37 AM )