Using & in a label
Moderator: Rathinagiri
Using & in a label
Hi, everyone.
I think I've discovered a bug!
I'm using 3.3.1 and XP3.
When I use Property Edit to enter the value of a label, and I type in "&" (the ampersand) instead of "and", it shows properly in the edit box (and shows properly again if I go back to edit it) but it doesn't show correctly on the label. Instead, it shows a double space where the " & " should be.
For example, If I enter
"Checking for this & that..." in the property edit box, it shows up as
"Checking for this that..." on the label itself - before and after compiling.
It's not a big problem, but it would sometimes be nice to be able to save the 2 extra character spaces that using "&" instead of "and" allows.
Thanks and regards to you all.
I think I've discovered a bug!
I'm using 3.3.1 and XP3.
When I use Property Edit to enter the value of a label, and I type in "&" (the ampersand) instead of "and", it shows properly in the edit box (and shows properly again if I go back to edit it) but it doesn't show correctly on the label. Instead, it shows a double space where the " & " should be.
For example, If I enter
"Checking for this & that..." in the property edit box, it shows up as
"Checking for this that..." on the label itself - before and after compiling.
It's not a big problem, but it would sometimes be nice to be able to save the 2 extra character spaces that using "&" instead of "and" allows.
Thanks and regards to you all.
Re: Using & in a label
& in conjuction with next character works like a hot key for control next to label.
If you want to use pure & char, you should change value of label after defining it, I think.
If you want to use pure & char, you should change value of label after defining it, I think.
Re: Using & in a label
Thanks. MOL. I understand what you're saying, but this is done through the Property Edit feature of the Objects Inspector.
I haven't tried (yet) to see what happens if I define or edit it using an external text editor (i.e., outside of the Objects Inspector), but I will, to see if that leaves my label intact -- but I still think it's a system bug that needs to be fixed, in that it's interpreting (misinterpreting!) the text of the label as having a control character in it.
Thanks again.
I haven't tried (yet) to see what happens if I define or edit it using an external text editor (i.e., outside of the Objects Inspector), but I will, to see if that leaves my label intact -- but I still think it's a system bug that needs to be fixed, in that it's interpreting (misinterpreting!) the text of the label as having a control character in it.
Thanks again.
Re: Using & in a label
It's very useful in my opinion, nt a bug.
But, it should exist a way to allow use "&" as common char, eg. \&;
something like html
But, it should exist a way to allow use "&" as common char, eg. \&;
something like html
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Using & in a label
Hi,
Wherever you want & inside label/menu control please use &&.
Consider this:
Wherever you want & inside label/menu control please use &&.
Consider this:
Code: Select all
#include <hmg.ch>
Function Main
define window x at 0, 0 width 400 height 300 main
define label l1
row 10
col 10
width 200
value 'A Sample & Label'
end label
define label l2
row 40
col 10
width 200
value 'A Sample && Label'
end label
end window
x.Center
x.Activate
Return
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Using & in a label
Ah! I suspected that I couldn't have been the first to encounter this!
You've solved the spacing problem that led me to discover this.
Perfect solution!
Thank you Rathinagiri
You've solved the spacing problem that led me to discover this.
Perfect solution!
Thank you Rathinagiri
Re: Using & in a label
Hi,Rathinagiri wrote:Hi,
Wherever you want & inside label/menu control please use &&.
Consider this:
Please be so kind to try also the updated sample below:
Code: Select all
#include <hmg.ch>
Function Main
define window x at 0, 0 width 400 height 300 main
define label l1
row 10
col 10
width 200
value 'A Sample & Label'
NOPREFIX .T.
end label
define label l2
row 40
col 10
width 200
value 'A Sample && Label'
end label
end window
x.Center
x.Activate
Return Nil
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- Rathinagiri
- Posts: 5480
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Using & in a label
Awesome Grigory! Thanks!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Using & in a label
Thanks for info!
I'm still learning and still foolish
I'm still learning and still foolish

Re: Using & in a label
Not at all foolish, MOL!
We all live and learn. (And sometimes forget!)
And I absolutely agree about having & as an operator/evaluator - I use it a lot! I'm just surprised that I haven't had (or don't remember?) the issue of it being inside a string before now!
I even tried (before posting) to search this site for "& in a label", but as the search stripped out the "& in a", that didn't help me much. And I can't see a way around that, either! Who can find this thread if they search for it using "&" as a key word?
But my concern (it wasn't really a "problem") is resolved, so thanks to all for that.
Now I need to go and check out Grigory's "NOPREFIX .T." addition
Thanks again.
CalScot

And I absolutely agree about having & as an operator/evaluator - I use it a lot! I'm just surprised that I haven't had (or don't remember?) the issue of it being inside a string before now!
I even tried (before posting) to search this site for "& in a label", but as the search stripped out the "& in a", that didn't help me much. And I can't see a way around that, either! Who can find this thread if they search for it using "&" as a key word?
But my concern (it wasn't really a "problem") is resolved, so thanks to all for that.
Now I need to go and check out Grigory's "NOPREFIX .T." addition

Thanks again.
CalScot