patrickTingen / DataDigger

A dynamic dataviewer for your Progress / OpenEdge databases
https://datadigger.wordpress.com/
MIT License
50 stars 24 forks source link

Export to 4GL does not escape curly braces #80

Closed patrickTingen closed 3 years ago

patrickTingen commented 3 years ago

I wanted to pass on a suggestion – when I dump to ABL and the character field contains special characters, ABL will skip the special characters during the ASSIGN.

To correct this I use CHR() equivalents. I’m wondering if you could change datadigger dump to be on the lookout for “{“ and “}” and convert to CHR(123) and CHR(125).

/* Data-create procedure */
DEFINE BUFFER cMsg FOR msg.

FIND cMsg EXCLUSIVE-LOCK WHERE cMsg.iMsgNr = 20070 NO-ERROR.
IF NOT AVAILABLE cMsg THEN CREATE cMsg.

ASSIGN
  cMsg.iMsgNr  = 20070
  cMsg.cMsgTxt = 'Users detected: {1}'
  cMsg.cTitle  = 'Service Pack Update'
  .

(Rob Willoughby, mail 3-sep-2021)

patrickTingen commented 3 years ago

Code changed to insert tildes right before an opening curly brace:

/* Data-create procedure */
DEFINE BUFFER cMsg FOR msg.

FIND cMsg EXCLUSIVE-LOCK WHERE cMsg.iMsgNr = 20070 NO-ERROR.
IF NOT AVAILABLE cMsg THEN CREATE cMsg.

ASSIGN
  cMsg.iMsgNr  = 20070
  cMsg.cMsgTxt = 'Users detected: ' + chr(126) + '{1}'
  cMsg.cTitle  = 'Service Pack Update'
  .