Answered Progress 4GL not reading backslash in UNIX Env

Saran

New Member
Hi Team,
I have a techi question - could be dumb (Sorry!). I am trying to read a string that will come from a DB or a 3rd Party app which has "\" (Backslash) in it. I am trying to replace the '\' with some other character, say '-' (Hypen); am not getting the desired output. [None of the Progress 4GL function reads backslash in Unix environment]

disp replace("saravana\kumar","~\","-") format "x(45)".

Output -
Windows: saravana-kumar
Unix: saravanakumar

I need Unix to say as the same way as Windows do.

Note - I will get the input as "saravana\kumar" which can not be asked to be sent as "saravana\\kumar".
 

Saran

New Member
Hi Cringer,
I tried this earlier and it was working when i ran it from the Windows env and not from Unix env.
 

Cringer

ProgressTalk.com Moderator
Staff member
Okie doke - then try this:
Code:
define variable lv-String as character no-undo. 

lv-String = "saravana\kumar".

message substring(lv-String,9,1) asc(substring(lv-String,9,1)) view-as alert-box.

This will tell you the character code that the system thinks it is getting. If it comes back as 92, then you'll have to amend the code that receives the data to do a similar thing to the above, and see what character code that thinks it's getting.
 

TomBascom

Curmudgeon
This:
Code:
display replace( "saravana\kumar", "~\", "-" ) format "x(45)".

Is not the same as reading the string from somewhere. This would be:
Code:
define variable someVar as character no-undo format "x(60)".
input from "backslash.dat".
import someVar.
input close.
display replace( someVar, "~\", "-") format "x(45)".

In your original code you do NOT have a string with a backslash in it. You have an escaped "k".
 
Top