General information
Category:
Coding, syntax & commands
>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only