Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove elements from an array
Message
From
09/12/2020 14:38:41
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01677490
Message ID:
01677491
Views:
55
>Hi,
>
>The way to populate an array from a current cursor is as follows:
>
>local array aDbfStruct[1]
>afields( aDbfStruct )
>
>
>But if you are using a SQL Server Native Client, some fields (e.g. Varchar(MAX) fields) will have the length 0.
>So, I need to remove these elements from the array aDbfStruct. Or exclude these elements when creating another cursor using the code:
>
>create cursor CUR_MYCURSOR from array aDbfStruct
>
>
>How do you remove all elements from the above array which have element 3 equal to 0 (zero)? Or, can the above CREATE CURSOR be modified to ignore the "bad" fields?
>
>UPDATE: I can scan the array and check each element 3 for a value of 0 and delete it. But I thought maybe there is a more efficient way to delete those elements.
>
>TIA
like this?
COPY STRUCTURE EXTENDED to TabXYZ
sele cur1.* from TabXYZ as Cur1 into array aDbfStruct where FIELD_LEN=0
use in TabXYZ
dele TabXYZ.*
and
COPY STRUCTURE EXTENDED to TabXYZ
dele from TabXYZ where FIELD_LEN=0
create newtable from TabXYZ
use in TabXYZ
dele TabXYZ.*
should work w/o array
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform