Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in Class Definitions?
Message
From
19/08/1999 15:26:59
 
 
To
19/08/1999 10:23:30
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00255262
Message ID:
00255485
Views:
18
>Here's a problem that I've just encountered. VFP has a problem with & in text literals in class definitions. It's probably getting mixed up with macro substitution somewhere - When there are spaces around the & all is ok.
>
>Here's a demo:-
>
>
>LOCAL loForm
>loForm = CREATEOBJECT("frmDemo")
>loForm.show
>
>READ EVENTS
>
>
>DEFINE CLASS frmDemo AS Form
>
>Caption = "Demo of ampersand problem"
>PROCEDURE Unload
> CLEAR EVENTS
>ENDPROC
>
>Add Object lbl1 AS lblDemo with top = 5, left = 5
>ENDDEFINE
>
>DEFINE Class lblDemo AS Label
> AutoSize = .t.
> Caption = "This&That"
>ENDDEFINE

This is a problem throughout VFP. The ampersand is almost always interpreted as a macro symbol, even if it is insinde a string literal. If you want to actually display the ampersand, use CHR(38):

Caption = "This" + CHR(38) + "That"
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform