General Help regarding HMG, Compilation, Linking, Samples
Moderator: Rathinagiri
franco
Posts: 877 Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada
Post
by franco » Sat Sep 30, 2017 1:24 am
Hi all,
I have run into something I can not figure out.
I have a label on a form
I have a customer`s name "G&G name"
when I say form.label.value := "Customer: "+customer->name
the label will not show the & the labels value becomes GG name.
any ideas;
Thanx .. Franco
All The Best,
Franco
Canada
mol
Posts: 3777 Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:
Post
by mol » Sat Sep 30, 2017 7:20 am
Transform & to && before writing to label value
Code: Select all
form.label.value := "Customer: "+strtran(customer->name, "&", "&&")
gfilatov
Posts: 1090 Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:
Post
by gfilatov » Sat Sep 30, 2017 11:30 am
franco wrote: ↑ Sat Sep 30, 2017 1:24 am
the label will not show the &
any ideas;
Thanx ..
Hello Franco,
Try to add the NOPREFIX clause to your Label definition.
Hope that helps
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
franco
Posts: 877 Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada
Post
by franco » Sat Sep 30, 2017 6:58 pm
Merek, this solved my problem. Thank you
Grigory I tried to add this but does not work for me . Where exactly do you add this clause.
Thanks again ......... Franco
All The Best,
Franco
Canada
KDJ
Posts: 243 Joined: Mon Sep 05, 2016 3:04 am
Location: Poland
Post
by KDJ » Sat Sep 30, 2017 8:59 pm
Franco
Here is an example:
Code: Select all
#include "hmg.ch"
MEMVAR _HMG_SYSDATA
FUNCTION Main()
LOCAL cText := "G&G name"
DEFINE WINDOW MainWnd;
ROW 100;
COL 100;
WIDTH 180;
HEIGHT 120;
TITLE "NOPREFIX label";
MAIN;
NOSIZE;
NOMINIMIZE;
NOMAXIMIZE
DEFINE LABEL Text1
ROW 20
COL 20
WIDTH 140
VALUE cText
NOPREFIX .F.
END LABEL
DEFINE LABEL Text2
ROW 50
COL 20
WIDTH 140
VALUE cText
NOPREFIX .T.
END LABEL
END WINDOW
MainWnd.ACTIVATE
RETURN NIL
franco
Posts: 877 Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada
Post
by franco » Sun Oct 01, 2017 4:02 am
Now I understand.
Thanks to all.
All The Best,
Franco
Canada