Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a function in FOR... ??
Message
From
26/01/2000 23:15:13
 
 
To
26/01/2000 22:19:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00323304
Message ID:
00323383
Views:
23
>>I have a function in the following code that Fox interprets as an array and throws the error "invalid subscript":
>>
>>Set Proc to Sysproc
>>Append from table.dbf for ctod2k(paydate) > dPay
>>
>>Ctod2k is a function in sysproc.prg .
>>
>>adte = ctod2k(paydate) works OK.
>>
>>Is there a way to get Fox to recognize ctod2k as a function and not an array? Seems to only happen in a filter or a FOR... clause.
>>TIA
>
>Do you have a variable with the same name?
No.
>
>On another note- are you sure you know exactly what the FOR clause in APPEND FROM does? Read the help file very carefully, you might be surprised- most people are.

When the receiving table modifies the state of the record (such as appending deleted records based on ...FOR DELETED()) the results are not intuitive. The APPEND I'm using doesn't fail the FOR... condition in the receiving table. Hence APPEND FROM table.dbf FOR ctod(paydate) > dPay does exactly what it appears it should. Notice the native Fox ctod() here. When I substitute my UDF ctod2k() Fox thinks it's an array.
Also, if I try:
SET FILTER TO ctod2k(paydate) > dPay
Fox throws the same error - "invalid subscript".

Again, SET FILTER TO ctod(paydate) > dPay works OK.

There is no variable or array by the name ctod2k declared elsewhere.

I must be missing something here. My question is how do I get my beloved Fox to respect a UDF in commands such as SET FILTER TO... or APPEND...FOR...?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform