neilsf/XC-BASIC

Suggestion: More escape sequences + improvement

Closed this issue · 3 comments

How about more escape sequences like {SPACE} or colors, eg. {GREEN}, {RED}, etc.? Also {UCASE}, {LCASE}, {F1}...{F8}

Improvement: adding a number to a escape sequence repeats it automatically, eg: {SPACE*27} writes 27 spaces.

Yeah, I wanted to add more but did not have time.

Actually, if you want to try, you can add them here from line 47:

ret = replace(ret, "{CRSR_RIGHT}", "\x1d");

All you have to do is add similar lines of code. The first string is the escape sequence and the second is the hexa PETSCII code. Of course it would be better to use some kind of lookup table but this will do, too.

Don't worry if you can't/don't want to do it, I also can, but it'll take some time.

About the repeat code: would be good, but I'm not sure it's worth the efforts. Sometime in the future mutable string support will be added which may require some rewrite anyway.

I'll do it.

Repeating escape sequences is useful on creating whole screens.

Hi, thanks a lot for your contribution! I have merged and compiled the latest binaries, you can now use them. I only tested some colors and they seem to work fine.

Make sure you use the develop branch next time (it was okay now, but easier to get everything - e. g compilation - done in the develop branch first and then merge it to master).