Page 1 of 1
KEYWORD PUT
Posted: Thu Aug 24, 2023 12:44 pm
by qbits
Can someone explain what I’m doing wrong? Or what is happening!
Re: KEYWORD PUT
Posted: Thu Aug 24, 2023 1:58 pm
by janbredenbeek
qbits wrote: Thu Aug 24, 2023 12:44 pm
Can someone explain what I’m doing wrong? Or what is happening!
PUT stores data in its internal form in a file, while PRINT stores it in the form as it is printed on the screen.
An integer variable is 2 bytes, a floating point variable 6 bytes and a string 2 bytes (the length) followed by the bytes of the string itself.
So PRINT#9;"Hello" prints the characters "Hello" followed by an EOL (LF) character to #9
and PUT#9;"Hello" prints the bytes 0, 5, and "Hello" (without LF!) to #9.
Re: KEYWORD PUT
Posted: Thu Aug 24, 2023 2:18 pm
by Derek_Stewart
Hi,
I always have problems with PUT, I generally use BPUT to handle bytes inserted into a file or channel.
Re: KEYWORD PUT
Posted: Thu Aug 24, 2023 6:30 pm
by qbits
Hi,
Thanks janbredenbeek I sort of remembered about the size of Str$ thing but your comments help switch the light back on.
That helped me get to where I wanted. My problem is now solved.
QBITS