reading_20and_20writing_20nonstandard_20values
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
reading_20and_20writing_20nonstandard_20values [2018/03/31 13:19] – external edit 127.0.0.1 | reading_20and_20writing_20nonstandard_20values [2024/01/05 00:21] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
//by J.G.Harston, | //by J.G.Harston, | ||
+ | <code bb4w> | ||
DEF FNrd16(I%): | DEF FNrd16(I%): | ||
+ | </ | ||
Read a 32-bit integer (same as **INPUT# | Read a 32-bit integer (same as **INPUT# | ||
+ | <code bb4w> | ||
DEF FNrd32(I%): | DEF FNrd32(I%): | ||
+ | </ | ||
Read a length-specified string (string length followed by string of up to 255 characters)\\ | Read a length-specified string (string length followed by string of up to 255 characters)\\ | ||
+ | <code bb4w> | ||
DEF FNrdStrN(I%): | DEF FNrdStrN(I%): | ||
REPEATA$=A$+BGET# | REPEATA$=A$+BGET# | ||
+ | </ | ||
Read a length-specified reversed string (string length followed by reversed string of up to 255 characters)\\ | Read a length-specified reversed string (string length followed by reversed string of up to 255 characters)\\ | ||
+ | <code bb4w> | ||
DEF FNrdStrR(I%): | DEF FNrdStrR(I%): | ||
REPEATA$=BGET# | REPEATA$=BGET# | ||
+ | </ | ||
Read a bit7-terminated string (final character has bit 7 set)\\ | Read a bit7-terminated string (final character has bit 7 set)\\ | ||
+ | <code bb4w> | ||
DEF FNrdStrB7(I%): | DEF FNrdStrB7(I%): | ||
+ | </ | ||
Write a 16-bit integer\\ | Write a 16-bit integer\\ | ||
+ | <code bb4w> | ||
DEF PROCwr16(O%, | DEF PROCwr16(O%, | ||
+ | </ | ||
Write a 32-bit integer (same as **PRINT# | Write a 32-bit integer (same as **PRINT# | ||
+ | <code bb4w> | ||
DEF PROCwr32(O%, | DEF PROCwr32(O%, | ||
+ | </ | ||
Write a length-specified string (string length followed by string of up to 255 characters)\\ | Write a length-specified string (string length followed by string of up to 255 characters)\\ | ||
+ | <code bb4w> | ||
DEF PROCwrStrN(O%, | DEF PROCwrStrN(O%, | ||
FOR A%=1 TO LEN A$: | FOR A%=1 TO LEN A$: | ||
+ | </ | ||
Write a length-specified reversed string (string length followed by reversed string of up to 255 characters)\\ | Write a length-specified reversed string (string length followed by reversed string of up to 255 characters)\\ | ||
+ | <code bb4w> | ||
DEF PROCwrStrN(O%, | DEF PROCwrStrN(O%, | ||
FOR A%=LEN A$ TO 1 STEP -1: | FOR A%=LEN A$ TO 1 STEP -1: | ||
+ | </ | ||
Write a bit7-terminated string (final character has bit 7 set)\\ | Write a bit7-terminated string (final character has bit 7 set)\\ | ||
+ | <code bb4w> | ||
DEF PROCwrStrB7(O%, | DEF PROCwrStrB7(O%, | ||
+ | </ | ||
===== Notes ===== | ===== Notes ===== | ||
Different varieties of BBC BASIC write and read data with **PRINT#** and **INPUT#** in different ways. You can only be certain that **INPUT#** will read data written by **PRINT#** with the same BBC BASIC. These functions allow you to impose the exact structure on the data you are writing, regardless of what platform BBC BASIC the program is running or where the data is going to or coming from.\\ \\ | Different varieties of BBC BASIC write and read data with **PRINT#** and **INPUT#** in different ways. You can only be certain that **INPUT#** will read data written by **PRINT#** with the same BBC BASIC. These functions allow you to impose the exact structure on the data you are writing, regardless of what platform BBC BASIC the program is running or where the data is going to or coming from.\\ \\ | ||
==== Comments by Richard Russell ==== | ==== Comments by Richard Russell ==== | ||
I don't believe that **INPUT# | I don't believe that **INPUT# | ||
+ | <code bb4w> | ||
DEF FNrd32(I%)=BGET# | DEF FNrd32(I%)=BGET# | ||
+ | </ | ||
The ' | The ' |
reading_20and_20writing_20nonstandard_20values.1522502376.txt.gz · Last modified: 2024/01/05 00:16 (external edit)