bpanda
31st December 2014, 13:26
Hi,

Whenever assigning "\r" to any variable it is showing "\\r".

Even tried with string of length 2 cahracters.

if use var(1;1) then also it is showing "\\".

Also tried with chr$(92) instead of using "\" but same result.

Why this is hapening ? Any suggestion...?

Thanks,
bpanda

bhushanchanda
31st December 2014, 14:59
Hi,

What are you trying to do?

If you just want to write this in a file, use

x = chr$(92) & "r"


e.g
string x(2)
long fp

fp = seq.open("test.txt","w+")
x = chr$(92) & "r"
seq.puts(x,fp)
seq.close(fp)

This will write \r in your text file.

bpanda
5th January 2015, 07:13
Hello,

Thanks for your reply.

I am trying to send mail from baan application through shell().
I am trying to put the command

awk 'sub("$","\r")'

If you check the variable It's considering awk 'sub("$","\\r")'


Thanks & Regards
Biswajyoti Panda

bhushanchanda
5th January 2015, 10:58
Hi,

If this is causing problems, you can simply write your command to a shell script and execute it from Baan.

bpanda
5th January 2015, 12:22
Thanks...
But I want to know the reason of condering "\\r" instead of "\r"

Thanks,
Bpanda

bhushanchanda
5th January 2015, 14:09
Hi,

"\" is a escape character in baan script. Baan usually uses "\\" to denote "\". Same goes with other languages like C# etc.

It's just an escaped string. The .Length property should recognize this and only return the proper length of a string. In other words, "\\" is "\", it's just represented as two slashes, because "\" is the escape character. To indicate that you really want a backslash, and don't want to escape the next character, you have to escape the backslash.

The Length property is unaffected by this, and counts "\\" as one character, the backslash.

bpanda
6th January 2015, 06:58
Hi Bhusan,

Thanks for your reply, I'm sure now this was not the problem.

I am facing problem while sending mails (from baan) multiple times.
Out of 40 mails sometimes 4-6 mails are missing or even more.
But in debug if I check, it's executing to send mail and failing.
if I use go to option in debug and execute that once again then it sends again & mail comes.

I tried with suspend() upto 5 minutes also, but the same result.
In the command there was "\r" which was considering "\\r" by baan.
So I guessed due to "\\r" it might be giving that problem.

I am working on unix server, Baan 5c

Thanks & Regards
Bpanda