Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable in 'Copy To' command
Message
 
To
30/12/2002 14:25:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00736690
Message ID:
00737610
Views:
14
>I have to to a 'Copy To' with sequential names, ie. "req001", "req002" etc.
>I can obviously just put a variable there because the file gets named with the variable.
>So, is there a way to do this?

Christopher,

You said sequential names. Is this done in a FOR...NEXT looping structure? If so, you could use the loop counter variable and a character variable to construct the name, rather than hard coding the sequential name.

As an example:

FOR lnLooper = 1 TO 10
lcLooper = PADL(ALLTRIM(STR(lnLooper)), 3, '0')
lcFile = 'req' + lcLooper
COPY TO (lcFile)
ENDFOR (or NEXT, whatever is your preference)

You can, of course, include the fully qualified path in the lcFile variable as well. You can even get the path from the user, if desired, and build the lcFile variable with that as a prefix.

Dana
Where's the damned Any Key?...too late
Previous
Reply
Map
View

Click here to load this message in the networking platform