Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For our Developers...
#11
@SpriggsySpriggs SpringgsySpingggs (What could have been).

Mutually exclusive. I meant enabling the saving of the control characters from the IDE to the file, not making a file name out of control characters.

So since I can't easily post CHR$(10) here, for example sake, let's say the asterisk, in my example below, is CHR$(10). As such, I cannot get this to save correctly from the IDE as demo.bas

PRINT "*"  ' <Remember, that asterisk is actually an inserted CHR$(10) glyph.

Oh sure, it will appear to 'save' it, but now open that file and you'll see it got changed to...

Print ""
" ' <Remember, that asterisk is actually an inserted CHR$(10) glyph.

So it's just about the inability to save some control characters like CHR$(10) and CHR$(13) as a quoted string, but definitely not about using them as file names.

Pete
Reply
#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
#13
Yeah, I know all of that, but are you sure since we do have the availability of binary file processing, it isn't possible? Have the IDE save it as binary file, and load it back as binary file. Besides, we are talking about a quoted string, so the tell is the control character is enclosed inside the quote marks.

Pete
Reply
#14
(04-04-2024, 07:35 PM)SpriggsySpriggs Wrote: What would be the point of needing those other characters in a file name?

maybe for our english is not my first language users and ets that want to use sign language

crap there was another page started since spriggsys comment
b = b + ...
Reply
#15
(04-03-2024, 11:39 PM)SMcNeill Wrote: A Highlight of Steve's Favorite Features of the Last Year(tm)!!
...
This is helpful to me too, who have been kinda busy and not able to fully explore all the new features - thanks for the summary
Tongue
Reply
#16
Ah, I completely misinterpreted what you meant about saving those characters. I genuinely thought you were trying to save filenames with odd characters in them. I understand now.
Tread on those who tread on you

Reply
#17
(04-05-2024, 04:43 PM)SpriggsySpriggs Wrote: Ah, I completely misinterpreted what you meant about saving those characters. I genuinely thought you were trying to save filenames with odd characters in them. I understand now.

it wasn't? ah maybe the thing about save file that started the post is what threw us off, so what was the chr$() about? using it inside files? don't we know that already? I thought using chr$() for filenames was great idea specially for aliens.
b = b + ...
Reply




Users browsing this thread: 1 Guest(s)