Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Single quote problem in CL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Single quote problem in CL

    CHGVAR VAR(&NEEDLE) VALUE('''') Example: If you had BOB'S BIKE, you need to double up that single quote to become BOB''S BIKE so CL can handle it. And since it's a string, you add single quotes around it like 'BOB''S BIKE' . And if you then strip out everything but the quotes, you get '''' . Chris

  • #2
    Single quote problem in CL

    Thanks dude!! You've just help me solved the other bigger problem. Anyway, you can also use X'7D' to replace ''''. For my simulation, I've changed the code. So, when I pass in PARM('Bob''''s Bike'), it shows &POS = 4. Cool dude Araman.
    Code

    Comment


    • #3
      Single quote problem in CL

      Using X'7D' is not a good idea. Depending on the environment the program is running in, it might not always translate to a single quote. You can take my advice and code a single quote as Inz('''') or Value('''') or learn the hard way someday. Chris

      Comment


      • #4
        Single quote problem in CL

        Hi Chris.. Oh.. Okey.. Points taken... Was actually using it to pass in string that may have single quote and replace it with a blank. Because will pass the string to an SQL statement. Previously caused error. Try to search the net for an examples. Never found one. Luckily you've help. Thanks very much Chris Araman

        Comment


        • #5
          Single quote problem in CL

          Greetings friends Below program shows example of QCLSCAN capabilities. But what happened when I try to search for single quote (')? Can anybody change the code to show the QCLSCAN can detect a single quote ('). (Because I haven't been successful on that!!) Anybody.. Please help... Rgds Araman.
          Code

          Comment

          Working...
          X