09-28-2021, 09:41 PM
<p>I sometimes hack about in BASIC for a bit of fun, and usually forget what I did.<br><br>VOICES as a function probably isn’t very useful any more, though LOCAL ERR,ERL,REPORT$ is handy. Even LOCALRND has its uses.<br><br>However, this one is so useful one might want to consider it for a future release:<br><br>STRING$(address,param[,maxlen])<br><br>param: b0-7 single terminator chr<br> b8 no single terminator chr (ignore b0-7)<br> b9 any ctrl terminates<br> b10 CR or LF terminates<br> b11 any top-bit-set byte terminates<br>or if negative, maxlen (and no 3rd arg)<br>In other words:<br><br>STRING$(addr,T) reads a string from memory, terminated by CHR$(T)<br>STRING$(addr,-L) reads a string of LEN L bytes, including CRs<br>STRING$(addr,T,L) reads a string terminated by CHR$(T) or LEN L<br>STRING$(addr,256,L) reads a string of LEN L, no terminator<br>STRING$(addr,512) reads a ctrl-terminated string<br>STRING$(addr,512+127) reads a string terminated by a ctrl or del<br>STRING$(addr,1024+0) reads a string terminated by 0, LF or CR<br>STRING$(addr,1024+13) reads a string terminated by CR or LF only<br>STRING$(addr,2048+512+127) reads a string made up of ASCII chrs only<br>STRING$(addr,32,12) reads a sprite name or drawfile group name<br>STRING$(addr,-4) reads a FourCC<br>STRING$(addr+1,-?addr) reads a Pascal string<br>(addr,-L) is just syntactic sugar for (addr,256,L).<br><br>And writen=SYS"OS_WriteN" should always have existed. I noticed in passing that the command SYS"Some_String" doesn’t use the SCT, so is always as slow as possible. Shame.<br></p>