Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COPY TO .... up to current record?
Message
From
11/03/2005 09:15:24
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
11/03/2005 08:34:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
00994688
Message ID:
00994792
Views:
28
>Tore --
>
>Unfortunately, neither of your suggestions are usable. The first fails because the table is ordered, so the record numbers appear to be random. The second fails for the same reason as well as because the table is filtered.

So then there is a key... and maybe a filter. How about this (had to use {{ and }} for text delimiters):
cOrder=key()
private uCurrent
uCurrent=eval(cOrder)
cFilter=filter()
if !empty(cFilter)
   cFilter=" and " +cFilter
endif
TEXT TO c NOSHOW TEXTMERGE
select * from TheTable where {{cOrder}}<=uCurrent {{cFilter}};
	into cursor tmp
ENDTEXT
=execscript(c)
With the filter there's an odd chance that the expression may include something that wouldn't work in a sql statement - in that case, this would have to be a "copy to ... for {{cOrder}}<=uCurrent {{cFilter}}"
There's

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform