Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append From works in command window only
Message
From
05/10/2005 16:27:35
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01056481
Message ID:
01056486
Views:
16
>Hello all,
>
>Yesterday I got stumped by this one.
>
>Something as simple as
Append From invoices.txt TYPE DELIMITED WITH TAB
simply wasn't working.
>
>I'd run the program and get a "Command contains unrecognized phrase/keyword." message.
>
>It was particularly puzzling because an Append command is probably as simple and straight-forward as they get.
>
>The syntax was all perfect, so I started considering things like data corrupted in such a way that vfp would choke and not even get the error message right.
>
>To further complicate things, I was able to run this in the command window without any problems, which then led me to think about a bug (great, just in time for sp1).
>
>After about an hour of tinkering and digging here in the archives I managed to solve the problem.
>
>I'm posting it here so that others bitten by similar problem don't have to spend the time.
>
>The problem lied in an #include file. In it, I had the following:
#define TAB  chr(9)
>so my
Append From invoices.txt TYPE DELIMITED WITH TAB
was being interpreted as
Append From invoices.txt TYPE DELIMITED WITH chr(9)
which is syntactically wrong.
>
>Workaround:
lcCommand = "Append From invoices.txt TYPE DELIMITED WITH TAB"
>&lcCommand
>
>Have fun!
>
>Alex

It's always a bad idea to #DEFINE reserved words, as you found out the tough way. :-)
Previous
Reply
Map
View

Click here to load this message in the networking platform