Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alen() how to insert record?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Alen() how to insert record?
Miscellaneous
Thread ID:
00946234
Message ID:
00946234
Views:
53
I loading an array to be used in a lookup/drop down list, but I need to insert a record into the array for a blank record for "unselecting" a value. The code below ends up replacing the first record with my blank record instead of inserting. Wondering if someone can point out my error.

Thanks
IF SQLEXEC(gnConnHandle,[exec dbo.lu_surgeon],"curAssist") < 1
	***************************************************************
	* No records for lookup, load a default blank value
	***************************************************************
	PUBLIC ARRAY laAssists[1,3]
	laAssists[1,1]=[]
	laAssists[1,2]=""
	laAssists[1,3]=0
ELSE 
	PUBLIC ARRAY laAssists[1,3]
	SELECT ALLTRIM(lastname)+[, ]+ALLTRIM(firstName),specdesc,coperid from curassist INTO ARRAY laAssists
	**********************************************************************
	* Redimension the array to have an extra record for a zero/blank value
	**********************************************************************
	DIMENSION laAssist[RECCOUNT("curassist")+1,3]
	**********************************************************************
	* Insert the blank/zero value into the array
	**********************************************************************
	AINS(laAssists,1)
	laAssists[1,1]=[]	&& Last,First Name
	laAssists[1,2]=""	&& Speciality
	laAssists[1,3]=0	&& Personnel ID
ENDIF 
Next
Reply
Map
View

Click here to load this message in the networking platform