Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equals? Why?
Message
From
15/07/2001 03:33:38
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00530280
Message ID:
00530753
Views:
15
>>>>>Hi,
>>>>>
>>>>>Why is there an equal sign (=) before some commands that I see? For example: i saw an example of the SetFileAttributes API Function. It was like this:
>>>>>
>>>>>=SetFileAttributes.........
>>>>>
>>>>>I wrote it using
>>>>>
>>>>>SetFileAttributes.........
>>>>>
>>>>>and worked just fine.
>>>>>
>>>>>What is the diference between them?
>>>>>
>>>>>TIA
>>>>>
>>>>>Alonso
>>>>
>>>>
>>>>In VFP 5 and before, all function calls had to be assigned to something, i.e
>>>>lcVar = FunctionName()
>>>>
>>>>If you didn't want the return value, then you could leave out the variable e.g.
>>>>= FunctionName()
>>>>
>>>>In VFP 6, the need to assign the return from a function was removed, so now you can just say:
>>>>FunctionName()
>>>
>>>That works in most cases, but with few exceptions. One exception is a seek function. You can not just call it seek(myValue).
>>
>>Sure you can. You just can't use the additional parameters. < s >
>>
>>What you're really running is not the SEEK() function, though, you're running the SEEK command. The parenthesis around the parameter are really being evaluated like name substitution or operator precedence.
>>
>>Think of it this way:
>>
>>SEEK         ("myvalue")
>>
>>is not the same as:
>>
>>= SEEK("myvalue")
>>
>
>Thanks, Fred. The mystery is solved :) Do you know some other examples, where functon and command have the same name? I could not think of any other...

The only other one I can think of besides the others that you've already found out about (SEEK, SELECT, SET) is REPL, the abreviation for REPLACE and REPLICATE(). Not quite the same thing, but close. I never run into that one because the only command I abbreviate in code is EVAL(), instead of EVALUATE().
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform