Unconfigured Ad Widget

Collapse

Single Quote

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • B.Morris
    Junior Member
    • Sep 2024
    • 531

    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';
  • Guest.Visitor

    #2
    Single 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....

    Comment

    • Guest.Visitor

      #3
      Single Quote

      How to embed a single quote in a text field using /free format. Thanks. txtfle = %trim(address1) + "'"; This doesnt worked. TIA Tiki

      Comment

      • Glenn McClenny
        Junior Member
        • Sep 2024
        • 1

        #4
        Single Quote

        Define a quote as a constant using a hex value
        Code

        Comment

        • B.Morris
          Junior Member
          • Sep 2024
          • 531

          #5
          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'.

          Comment

          Working...
          X