Page 1 of 1
ASCII problem !!
Posted: Mon May 26, 2014 8:45 am
by beber005
Hi everyone,
I have a little problem, I don't know how to use code ASCII. I want to specify in this formula (for example)
Code: Select all
ASCIIOutput (cOutputLog 'Error copying process');
a newline. Let me explain: This final variable is a body of an email and I return regularly to the line. However, I do not know how to do that thank's to TM1. In other language, you just need to specify
"\ n" in the string to do this but there ...
Thank you very much for your help

Re: ASCII problem !!
Posted: Mon May 26, 2014 8:52 am
by Alan Kirk
beber005 wrote:Hi everyone,
I have a little problem, I don't know how to use code ASCII. I want to specify in this formula (for example)
Code: Select all
ASCIIOutput (cOutputLog 'Error copying process');
a newline. Let me explain: This final variable is a body of an email and I return regularly to the line. However, I do not know how to do that thank's to TM1. In other language, you just need to specify
"\ n" in the string to do this but there ...
Thank you very much for your help

That's not a formula. And I'm not being pedantic when I say that, I mean that it's not intended to calculate anything. All it does is to output the text that you specify in the second (and following, if applicable) arguments into the file that you specify in the first argument.
There is no need to append a new line to the output string; every time you write a string to an ASCII file it goes onto a new line anyway.
If you want to insert a blank line below your output, you could use the Code() rules functions to append the relevant ASCII characters to the string (typically CR and LF) or, perhaps even more simply, just add an extra ASCIIOutput command which inserts a blank line below your existing one:
Code: Select all
ASCIIOutput (cOutputLog, 'Error copying process');
ASCIIOutput (cOutputLog, '');
Re: ASCII problem !!
Posted: Mon May 26, 2014 9:02 am
by Wim Gielis
And also, do not forget the comma after the filename for the asciioutput.
Re: ASCII problem !!
Posted: Mon May 26, 2014 9:03 am
by beber005
Yes I know Kirk, you play with words ^ ^
No, I can not write another ASCIIOutput. My return line must be in the same ASCIIOutput because it is sent or rather used by the SMTP service. In short there is not the problem, ultimately what I wanted to know was if it was possible to have an equivalent of "\ n"
So yes I used the CODE () function and I know the ASCII code '' but I do not know then use

Re: ASCII problem !!
Posted: Mon May 26, 2014 10:28 am
by Alan Kirk
beber005 wrote:Yes I know Kirk, you play with words ^ ^
No, I can not write another ASCIIOutput. My return line must be in the same ASCIIOutput because it is sent or rather used by the SMTP service. In short there is not the problem, ultimately what I wanted to know was if it was possible to have an equivalent of "\ n"
So yes I used the CODE () function and I know the ASCII code '' but I do not know then use

"I am not playing. This is not a a game..."
[1]
I do however sometimes mistype; I said Code but meant Char. (Code goes in the opposite direction.)
The ASCII equivalent to \n is the newline character, or Char(10). Thus:
Code: Select all
# Assuming that you don't want the content surrounded in quotes, as seems likely:
DatasourceASCIIQuoteCharacter='';
s_OutputString = 'Error copying process' | Char(10);
ASCIIOutput (cOutputLog, s_OutputString );
However I'm still not at all clear on what you mean to do with this since the only thing that ASCIIOutput does is generate a text file, and in that respect it doesn't matter whether it does it in one step or two.
--------------------
[1] Obscure quotation from the same source as my current signature.
Re: ASCII problem !!
Posted: Mon May 26, 2014 11:44 am
by beber005
Ok alan I didn't remember the function "CHAR()" sorry. But yes with it's working. What I do it's not easier to explain
