Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Syntax error - Urgent!
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00475084
Message ID:
00475245
Views:
37
Hi Vlad,

Since the Stats application is my application, I know the meanning of each parameter. This particular parameter is a character type. In my code I check for
if empty(param) or vartype(param)<>"C"
        do something
    else
        param=Proper(param)
    endif
Anyway, I think, the problem is in something else. Perhaps, incorrect usage of single/double quotes, which I could not catch. I'll try few more tests, I also make my program to properly default parameters, if they are omitted.

>Hi!
>
>As I said, use .F. instead of "" (Logical type .F., not a character string). In VFP all omitted parameters of procedure checked using !(vartype("something") == "L"). If it is logical and .F., probably it is omitted when procedure called. So .F. should work in your case when the application expects omitted parameters. "" - is not omitted parameter and might have significant value for the application/procedure you call.
>
>HTH.
>
>>Vlad,
>>
>>I put "" instead of empty parameter, but it didn't help :( This is really weird, because the similar code worked fine in other cases. May be I just don't see something simple?
>>
>>BTW, cmd is stored in a Table, e.g. table has a Memo field CallProc. The program reads content of this memo field into variable cmd, and then
>>&cmd.
>>This line gave me a Syntax error.
>>
>>I can, however, execute the same line from the command window....
>>
>>Thanks in advance.
>>
>>>Hi!
>>>
>>>I guess no, but you're calling app that might have differences. To be sure try to put .F. on that place (skipped parameters will contain .F. anyway in the called procedure).
>>>
>>>In addition, inside '[]' brackets include file constant definitions are processed, so strings there might be replaced by something. For example, when you have somewhere in the code following definition
>>>
>>>#define curState 1
>>>
>>>you will probably get error even when command looks correct. Try to use '""' instead of square brackets.
>>>
>>>HTH.
>>>
>>>>Hi everyone,
>>>>
>>>>I have "Syntax error" on this line of code (not my application):
>>>>&cmd.
>>>>
>>>>cmd=[do stats.app with 'run', '2YearsRpt', 'vAllConfigs','\redp\dbc\'+oJC.curState+'\'+oJC.curState+'Stats',ojc.outtable,oJC.CalYear, , oJC.ccode, oJC.CalPeriod]
>>>>All oJC properties have thier values:
>>>>oJC.outTable="redp\Putput\Stats\Harford"
>>>>oJC.curState="CT"
>>>>oJC.CalPeriod="12"
>>>>oJC.CalYear="2000"
>>>>oJC.ccode="31"
>>>>
>>>>Could it be a problem, what one parameter is skipped?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform