Monday, April 17, 2023

Experimenting with Unicode Characters in Identifiers and Line Labels

Finding emojis useful for sporadic "grab-you by the jugular" icons, I'm now experimenting with Unicode characters for more numerous things I want grabbing my attention without doing so obnoxiously.

Note: I am experimenting with these as a way to help folk with cognitive/visual disabilities, to make it easier to locate/identify sections of code.

Emojis are pretty quick to access, at least on my Chromebook: right-click and click on emojis to access them in a dialog.

Unicode character access was requiring too many steps, so I've added a section for Unicode characters in the Lookups Window (in the menu: Tools - Lookups).  This brings up the List of Unicode characters Wikipedia page, and provides a field in which you can copy/paste frequently used Unicode characters.  (IF IT IS SOMETHING YOU WANT TO EXPERIMENT WITH TOO !!!)



EDIT:

A big reason I'm using GOTO's in this sample: getting old non-structured BASIC programs working in BASIC Anywhere Machine is a ton of fun, especially when exported programs can be shared as small HTML files on the web.

I see Unicode characters and emojis as a way to help see parts of these old BASIC programs in order to create structured versions of them.

The arrows make it a little easier to find/identify branching/flow, and that "STOP" character makes it really easy to pinpoint the END of the program.




2 comments:

  1. This might also be useful for naming/locating variables.

    For example, it is pretty common to use one-letter variable names for variables used in loops.

    Say the variable is "i", it is kind of hard to find all of the occurences of that variable in a program, because the letter "i" could appear anywhere.

    However, if we name the variable with a prefix "โถi", it would be likely unique while staying compact, and be easy to search for to find only exact matches.

    ReplyDelete
  2. For my mini-BASIC, Flag characters like โš‘ or ๐Ÿšฉ are like whitespace. This turns out to be much nicer than I anticipated; you can add or remove flags from a line of code to mark things you know you need to get back to, or lines that you want someone else to see.

    What didn't work as well: I defined way too many flag characters as this special thing. Just a few (the red one is particularly nice) would be enough; I didn't need to go beyond and allow the ten or twenty different ones.

    I also allow for "pretty math characters", so that รท and / both do the same thing.

    ReplyDelete

๐Ÿ“š Simulating OOP Methods in BAM Using GOSUB

BASIC Anywhere Machine's GOSUB implementation allows using numeric expressions for dynamic line numbers or using string expressions for ...