Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can someone explain why macro needs to have 2 dots?
Message
From
19/02/2007 09:59:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
19/02/2007 07:09:25
Suhas Hegde
Dental Surgeon
Sirsi, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01196999
Message ID:
01197023
Views:
17
>hello all,
>
>Can some 1 explain This ?
>
>m.abc = 'Containername'
>
>thisform.&abc..visible = .t. --- && Works
>thisform.&abc.visible = .t. --- && fails error thisform.containernamevisible not found ???
>
>
>
>suhashegde

Suhas,
By language specification . ends macro substitution.

thisform.&abc..visible is interpreted as "thisform.Containername.visible
while:
thisform.&abc.visible is interpreted as "thisform.Containernamevisible

In fact macro in such cases do not need a dot because you don't need a macro - read it as "do not use macro where you don't need it:)
with eval('thisform.' + m.abc)
  .Visible = .t.
endwith
Is a better construct IMHO.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform