what are the codes for CR and LF?

Stellaferox

Active Member
Licensed User
Hi,

I want to know the codes for CR and LF or CRLF. I am writing a subroutine in which a string is truncated after a pair of numbers separated by a CRLF (which takes 2 places in the string).
The datastring = "1,0" & CRLF & "2,0" & CRLF & "3,0" & CRLF & "4,0" & CRLF & "5,1" & CRLF & "6,0" & CRLF & "7,1" & CRLF & "8,0" & CRLF & "9,1" & CRLF & "10,1" & CRLF
But after reading the pair "5,1" the subroutine doesn't recognize the CRLF anymore. This is due to the 1 after the 5 (I changed this to try out).

the subroutine is
s = 0 '// set STOPsign
k = 0
dd = 0
DO WHILE (k < StrLength(D$)-1) AND (s=0)
T$ = StrAt(D$,k)
IF T$ = cCRLF then
dd = k
s = 1
END IF
k=k+1 'remember there is always an increment after the stopsign
LOOP

Any ideas?
thnx
Marc
 

Stellaferox

Active Member
Licensed User
Erel,
Thnx, I know about the $ sign but I am tranlsating old code here and it kind of sticks on my mind..... :D
Still don't know why the subroutine errors though...
Marc
 

Stellaferox

Active Member
Licensed User
Hi Erel, No I am not using it elsewhere and I always uncheck the unassigned variables because it is a bit annoying when translating from other code.
But I got it working using CHR(13) and not the CRLF constant....
thnx
Marc
 
Top