Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

No blank line in TEXT...ENDTEXT in a LIBRARY function

Aug
1,904
68
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  26.01.40 x64   Windows 10 [Version 10.0.18362.836]

Can anyone duplicate this?

When using TEXT..ENDTEXT in a LIBRARY function, I cannot get a blank line. Example;

Code:
Test {
text
1

2

3
endtext
}
...returns...
Code:
e:\utils>which test
test is a library function

e:\utils>test
text
1
2
3

FONT for both TCMD and TCC;
Code:
e:\utils>echo %@font[0] %@font[1] %@font[2] %@font[3] %@font[4] %@font[5]
Consolas 15 32 700 54 0

Joe
 
No surprise. Blank lines are removed when library routines are stored in memory.

Code:
d:\data\tcclibrary> type test.btm
test {
text
1

2

3
endtext
}

d:\data\tcclibrary> library /u /r test.btm

d:\data\tcclibrary> library /f test
test {
text
1
2
3
endtext
}
 
TCC strips all leading & trailing whitespace from the line. If the line is (then) empty, TCC doesn't save it in memory. If you want to display blank lines, use escape sequences.
How, exactly? Neither of these, ^r^n and ^e[0m, seem to work.

LIBRARY /F
Code:
COMMENT
for  i = 0, 1, 2, ...^r^n
s[i]   = process name
s[i+1] = process start time as YYYYMMDDHHMMSS.uuuuuu±ZZZ
^e[0m
s[i+2] = process ID
ENDCOMMENT

If I can get a real ESC in there (not easy with my editor) it'll work.

EDITOR:
1594482458322.png


LIBRARY /F
Code:
COMMENT
for  i = 0, 1, 2, ...
s[i]   = process name
s[i+1] = process start time as YYYYMMDDHHMMSS.uuuuuu±ZZZ

s[i+2] = process ID
ENDCOMMENT
 
Thanks @rconn and @vefatica !

From Notepad++, I used ALT 027 from the numeric keypad, which gives me the following;
1594485625122.png

...and all of them provide a blank line;
1594485680022.png

Joe
 
That doesn't work in TextPad, my preferred editor (or notepad). And even in NPP you must NumLock.
 
In TextPad you can replace a character with escape, in regex mode, using \x1b . Tedious, but possible.
 

Similar threads

Back
Top