Single Quote
Glenn McClenny wrote: > > Define a quote as a constant using a hex value > > Code <'http://www.mcpressonline.com/mc/showcode@@.6b3a09fb/2'> Using hex literals for "ordinary" characters is not portable to other platforms. If your code is ever used on an ASCII system (say with VA RPG), it will not work. (Even if _your_ code is never used for VA RPG, a VA RPG programmer might read your tip and think it would work.) Defining a named constant is great, but define it with ordinary RPG syntax ('''') rather than the mysterious x'7D'.
Unconfigured Ad Widget
Collapse
Single Quote
Collapse
X
-
-
Guest repliedSingle Quote
How to embed a single quote in a text field using /free format. Thanks. txtfle = %trim(address1) + "'"; This doesnt worked. TIA Tiki
Leave a comment:
-
-
Guest repliedSingle Quote
It is very handy to create /copy RPGLE source member with hex values for most common used characters in your /free RPG expressions and use constants from it in your programs. You'll solve a lot of problems for yourself....
Leave a comment:
-
-
Single Quote
tiki wrote: > > How to embed a single quote in a text field using /free format. > Thanks. > txtfle = %trim(address1) + "'"; This doesnt worked. txtfile = %trim(address1) + ''''; or D quote c '''' txtfile = %trim(address1) + quote; When you want to code a quote within a literal, you have to use two quotes. If you wanted to get "Joe's Eats" you would code txt = 'Joe''s Eats';Tags: None
-
Leave a comment: