Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For our Developers...
#12
That's just a BASIC limit with PRINT.   Print was meant to print text to a file, and with text, CHR$(10) and CHR$(13) are your Carriage Return and Line Feed characters. 

PRINT "Hello" + CHR$(13) + "World"   <-- run that in the IDE and see the output.   It prints "Hello" on one line and "World" on the second.

Now, if we set _CONTROLCHR OFF, we can print those ascii symbols to the screen, but we still don't PRINT them to a file as it'd basically make that file impossible to decipher in ther future properly.

PRINT #1, "Hello" + CHR$(13) + "World"
PRINT #1, "My name is Steve"

Now, how do you propose we write that so that you can still read it with an INPUT # statement?

On the disk, that file looks like: "Hello13World13My name is Steve"   (With 13 representing those CHR$(13) statements.

Input (or even LINE INPUT) will read that file from left to right, find the first line break -- CHR$(13) and then call that a day.  "Hello" + CHR$(13)  <-- one line of text.   "World" + CHR$(13) will be the 2nd line of text.   

How do you suggest INPUT reads that so that it'll know the first 13 is the musiclal note, while the 2nd 13 is the line break??

It's for reasons like this that you can open a file FOR BINARY and then GET/PUT the data as you want with it.  Wink
Reply


Messages In This Thread
For our Developers... - by Pete - 04-03-2024, 10:40 PM
RE: For our Developers... - by Pete - 04-03-2024, 10:53 PM
RE: For our Developers... - by RhoSigma - 04-03-2024, 11:15 PM
RE: For our Developers... - by Pete - 04-03-2024, 11:26 PM
RE: For our Developers... - by SMcNeill - 04-03-2024, 11:39 PM
RE: For our Developers... - by madscijr - 04-05-2024, 01:00 PM
RE: For our Developers... - by Pete - 04-03-2024, 11:49 PM
RE: For our Developers... - by Pete - 04-04-2024, 12:08 AM
RE: For our Developers... - by TDarcos - 04-04-2024, 12:11 AM
RE: For our Developers... - by Pete - 04-04-2024, 12:34 AM
RE: For our Developers... - by SpriggsySpriggs - 04-04-2024, 07:35 PM
RE: For our Developers... - by bplus - 04-05-2024, 11:32 AM
RE: For our Developers... - by Pete - 04-04-2024, 07:53 PM
RE: For our Developers... - by SMcNeill - 04-04-2024, 10:25 PM
RE: For our Developers... - by Pete - 04-04-2024, 10:52 PM
RE: For our Developers... - by SpriggsySpriggs - 04-05-2024, 04:43 PM
RE: For our Developers... - by bplus - 04-05-2024, 05:00 PM



Users browsing this thread: 2 Guest(s)