2022-05-01 13:33:35 One little glitch popped up in the EXPECT stuff last night. Later on I noticed that the "buffer full" test wasn't working right anymore. I stopped adding bytes to the buffer, but the screen got fouled. 2022-05-01 13:35:15 That full test was at the beginning of the word that inserts new characters. I pushed that insert word down a level. The test sent me back to that new word instead of where it was designed to send me. 2022-05-01 13:35:34 Anyway, I just moved the test word up into the new layer, and that fixed it. But it did have to be "touched." :-) 2022-05-01 15:18:54 Hey, does anyone happen to know if the ANSI sequences for cursor position save and restore can be "nested"? Or is it just "one deep"? 2022-05-01 15:19:24 pretty sure its only one deep 2022-05-01 15:19:53 Yeah - somehow I've a nagging feeling of that as well. 2022-05-01 15:20:40 Guess it's nice it's there at all. 2022-05-01 19:08:24 Hey - here's a neat trick. Say you have a 64-bit item with a utf-8 char in the low bytes, and zero otherwise. You need to insert that into a fixed size buffer of text, but you don't want to unless doing so won't push any "non-space" bytes off the end of the buffer. 2022-05-01 19:08:50 Here's how to do it. Grab the last four bytes of the buffer, and xor that with 0x20202020. 2022-05-01 19:09:10 Now form the "byte-wise inner product" of that with your insert char bytes. 2022-05-01 19:09:23 If the total inner product result is zero, you are safe to proceed. 2022-05-01 19:09:38 I think that will work regardless of how many non-zero bytes you have in your char cell. 2022-05-01 19:09:47 Well, up to four. 2022-05-01 19:10:39 If a buffer byte isn't a space, you'll get non-zero in that byte of the xor. But if you don't need that many bytes, then that byte of your incoming will be zero. 2022-05-01 19:11:22 I like how that combines logic and arithmetic in a useful way. 2022-05-01 19:11:42 I was really chafing at the idea of basically having to do four separate tests. 2022-05-01 19:12:59 I've spent the day today tweaking READ so that it works as needed in EXPECT, but also can be called to let you edit a fixed size buffer anywhere in RAM. 2022-05-01 19:14:53 That's all done now except for implementing the test I just described. Right now it just "cliff pushes" bytes off the high end, regardless of what they are. 2022-05-01 19:15:12 Which isn't actually a "wrong" behavior; just a little undesirable. 2022-05-01 19:15:58 At first it was pushing a byte or two into the space just beyond the buffer, but I fixed that.