Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compiler does not catch this syntax error, bug?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00901990
Message ID:
00902646
Views:
13
Hi, Sergey,

Thanks for the message.


Based on your example, it is NOT neccessary to use macros.

In my code, I have situations where I would pass the alias name as a parameter. The reason is that I would create a temparary table based on a predefined structure, the table name is generated from sys(2015), in othercases, I would open a table "again" using a diffent alias. So macros are very helpful, for example:
function GetNames(lpcAlias,lpcIntoCursor,lpcCondition)
 select (Upper(&lpcAlias..name)) as Name ;
 from &lpcAlias ;
 where &lpcCondition ;
 into cursor &pcIntoCursor
endfunc && GetNames
If I missed typed, I could get
 select (Upper&lpcAlias..name)) as Name, ;
 from &lpcAlias ;
 where &lpcCondition ;
 into cursor &pcIntoCursor
In this case, a warning would be helpful, then correct it right there. Of course, the other side of the coin is that the warning could become very annoying unless an option is given to set the level of the warning.

By the way, I've seen this before. What does "<snip>" mean?

Dawa


For example,
m.name = "aaaa"
>lcAlias = "(m"
>? Upper&lcAlias..Name)
>
There's no need to use marcos in those cases.
Transform(EVAL(lcAlias + ".FileNumber"))
>Upper(EVAL(lcAlias + ".Name"))
>
>>
>>You may have read what Frank Camp posted. Now, I see the challenge posed by & macros to compiler.
>>However, it would be a good idea and very helpful, in my case and many other cases such as
>>
>>Transform(&lcAlias..FileNumber
>>Upper&lcAlias..Name)
>>
>>for the compiler to issue the programer a warning of some sort.
>>
><snip>
Dawa Tsering


"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."

- Ephesians 4:29-30 NIV

Dare to Question -- Care to Answer

Time is like water in a sponge, as long as you are willing you can always squeeze some.

--Lu Xun, Father of Modern Chinese Literature

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform