Otherwise, if you have "\x014", then that would be interpreted as
hex number 14, which would be interpreted as a different
character.
didnt i give you and other people xchange32? http://bbses.info/mirrors/clayruth.com/index.html
Re: Re: Help, It's my fault this time
By: DesotoFireflite to Nightfox on Fri Jul 22 2022 02:15 pm
I started getting into the habit of using \x01 in any strings
rather than using literal Ctrl-A codes. That can help prevent
editors from changing those characters.
Yes, I'm starting to do that too, but some of the older ones I've done, still have the leteral code, and I don't see it till I edit it, then I have to go back and change it :)
Why not do a search & replace in your editor?
One caveat that I've found though is that if you're using background codes (which are numeric), I ended up splitting the string; otherwise it would interpret the nex number wrong.
For instance, if you want to output a blue background (Ctrl-A + 4), then I'd do this in JavaScript:
"\x01" + "4";
Otherwise, if you have "\x014", then that would be interpreted as hex number 14, which would be interpreted as a different character.
That's true for "\x14" (hex 14), but not for "\x014" (hex 01, followed by a '4'). "\x014" works fine, you don't need to split string or any other tricks.
I love VS Code, but I've found out that it does alter the code
sometimes if you use Ctrl-A codes in it, so you have to watch it.
Notepad ++ doesn't change the contents of the file automaticly the way
VS Code has done on occasion to me.
Keeping the JS Object model docs open is also really helpful.
Yes, it my stage of learning, the JS Object Model is my bible.
One caveat that I've found though is that if you're using background
codes (which are numeric), I ended up splitting the string; otherwise
it would interpret the nex number wrong.
For instance, if you want to output a blue background (Ctrl-A + 4),
then I'd do this in JavaScript:
"\x01" + "4";
Otherwise, if you have "\x014", then that would be interpreted as hex
number 14, which would be interpreted as a different character.
Rob,
Does Synchronet have such a thing as "command stacking", such as
where you could put several commands into one string?? Obviously,
it wouldn't work if the hotkeys were ON, but one of my users asked
about it...and if it's in the docs, I've overlooked it.
I love VS Code, but I've found out that it does alter the code
sometimes if you use Ctrl-A codes in it, so you have to watch it.
Notepad ++ doesn't change the contents of the file automaticly the way
VS Code has done on occasion to me.
This can help...
https://gist.github.com/tracker1/ac95a8de20366e66d57801e9edc96dbe
But CP437 support seems to be broken on non-windows... so ymmv there, I usually encode my special characters in JS anyway... "\001" inside the string is effectively ctrl-A (as is "\x01" or "\u0001"), though I don't think JS in Synchronet supports the unicode escape.
You can change the auto-formatting behavior... I keep a different config in my sbbs directory, which is usually what I open in VS Code (remoting extensions are great, can edit BBS over SSH).
Keeping the JS Object model docs open is also really helpful.
Yes, it my stage of learning, the JS Object Model is my bible.
For Synchronet, need to keep it open all the time... though still often need to dig through /exec for practical examples as it's not always clear.
Have you tried using the octal escape? "\001" instead? Not sure, but I don't think I've seen an issue with it.
Rob,
Does Synchronet have such a thing as "command stacking", such as
where you could put several commands into one string?? Obviously,
it wouldn't work if the hotkeys were ON, but one of my users asked
about it...and if it's in the docs, I've overlooked it.
Have you tried using the octal escape? "\001" instead? Not sure, but I don't think I've seen an issue with it.
Does Synchronet have such a thing as "command stacking", such as
where you could put several commands into one string?? Obviously,
it wouldn't work if the hotkeys were ON, but one of my users asked
about it...and if it's in the docs, I've overlooked it.
It's up to the command shell to support that. I seem to recall adding
that support in the PCBoard clone command shell.
Sysop: | Kurt Hamm |
---|---|
Location: | Columbia, SC |
Users: | 7 |
Nodes: | 20 (0 / 20) |
Uptime: | 228:25:38 |
Calls: | 2,774 |
Calls today: | 2 |
Files: | 64 |
Messages: | 848,178 |