Nivekk / KOS

Fully programmable autopilot mod for KSP.
Other
80 stars 30 forks source link

PRINT.. AT (COLUMN,LINE) terminates program when string length is larger than terminal window width. #229

Open Artorp opened 10 years ago

Artorp commented 10 years ago

This line of code will terminate a running program:

print "                                                   " at (0,0).

Alternatively:

print "hello" at (49,0).
a1270 commented 10 years ago

You're printing off screen. Guess a fix got committed without a notice. Your first example is trying to print to column 52 of 50 and the second one is printing to line 54 of 50. I'll try to remember what branch my line-wrapping went into. I should also add a notice about into the readme.

So for columns: 49(50 counted from zero) - length of string and the max row you can print is 34(36 from zero eq 35 - 1) as you can't print on prompt.

Artorp commented 10 years ago

Looks like it is fixed, this was committed last week: be3114e6939cfd9a3898bceef81039ab9b87f549

a1270 commented 10 years ago

What that commit does it just drops off the extra chars. So your second example would just print 'h' while dropping off 'ello'. You don't get a out of array issue. I am guessing/hoping this is precursor work for line wrapping. Truncating is not a good idea in my opinion.