View Single Post
Old 01-10-2018, 06:01 AM   #37
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 133
Default Guidance on EEL strings and characters

Fundorin. Take a step back from the code that is now becoming a bit frustrating and try and think about what is happening with characters and strings and their representation within EEL and in the computer itself.

Piece this thinking together one step at time.

There are a number of separate but related key topics as follows, which if understood better leads to the "answer", and when, or if any character or string "conversion" is taking, or needs to take place.

The (loosely called) character might appear

- As a 7 bit value in a SYSEX byte

- As a series of bytes concatenated together that make a SYSEX byte stream (that could be called a "byte string")

-As a character value stored in an EEL string
-- How that value is stored in EEL
-- What that value is intended to represent internally in EEL, or mean or become externally
Note that all the string functions in OSCII-bot take place on these string values not characters.
Using "Unsigned chars" in str_getchar() will be the safest way to explicitly read or write the whole 8 bits of the desired character in a string.

Influencing this EEL string storage there are the OSCII-bot variables that are really designed to store a 64bit double precision real number but they are also adapted for characters and strings by pointing to a string buffer.

- As a character, string, hex or octal representation in an external output stream (which could be to a GUI console, terminal, printer or file output) or at compile time when coded representations and escape characters are converted into internal storage values. These representations are what is shown in the example white tables in post #34. These are not the same as the internal representations although they are related by a chosen or inbuilt input or output conversion.

To manipulate characters for SYSEX one needs to understand 7 bit ASCII characters and the difference between printable and non printable characters. There is a lot of tutorial material on the nature of characters for the C programming language but take care in that C strings are rather different to EEL strings.

Hope that helps a bit and gives the correct computer/EEL terminology in which to ask more detailed or specific questions.
goldenarpharazon is offline   Reply With Quote