Page 1 of 1

Playing with strings...

Posted: Tue May 12, 2009 4:29 pm
by Brana
Why is this possible:

5 CLS
10 A$=CHR$(129)
20 A$=A$+"BRANA"
30 PRINT A$

(You will see my name, "Brana" in red color on the screen)

But, this is impossible:

5 CLS
10 A$=CHR$(129)
20 A$=A$+"BRANA"
30 A$=A$+CHR$(13) : REM - NEW LINE / RETURN
40 A$=A$+"GAVRIC"
50 PRINT A$

(You will now see only my last name, "Gavric" in white color, but "Brana" seems to get "lost" somewhere?!)

However, if I add the line 60 as follows:

60 PRINT LEN(A$)

I will get 13 in return;

1 CHR$(129)
2 B
3 R
4 A
5 N
6 A
7 CHR$(13)
8 G
9 A
10 V
11 R
12 I
13 C

So, everything appears to be present, but first part of the string ("Brana") now is NOT displayed on screen!

In another words, why can't I add the value of CHR$(13), which is equivalent of "ENTER", to a single string, in order to have that string displayed in two rows on the screen?

I CAN add values of color (example CHR$(133)) to a single string. Why can't it work with CHR$(13) as well?

Best regards
Brana

Posted: Tue May 12, 2009 6:47 pm
by Dbug
Try CHR$(10)+CHR$(13).
I believe 13 only put back the cursor at the begining of the line (carriage return) and that you need a cursor down (line feed) to go to the next line.

Re: That is! Thank You!

Posted: Tue May 12, 2009 7:04 pm
by Brana
That is!

Thank You!

Brana