U++ framework
Do not panic. Ask here before giving up.

Home » Extra libraries, Code snippets, applications etc. » U++ Esc Interpreter, Esc Macros and templates » simple enhancement for EscValue (ESC_ARRAY is ambigous - is array or is string? newfunc - IsString)
simple enhancement for EscValue [message #62044] Tue, 04 August 2026 20:19 Go to previous message
luoganda is currently offline  luoganda
Messages: 219
Registered: November 2016
Experienced Member
[edit: added]
Also - a small typo in EscStdLib.cpp:
Escape(global, "OpenFileOut(x)", ESC_OpenFileOut);
Escape(global, "OpenFileAppend(x)", ESC_OpenFileOut);

Just this is missing in EscValue.

EscValue has eg ESC_ARRAY,
but when one does not in advance know if it's an array(eg arr[0] arr[1],...) vs is string "abcd",
it can't continue.
Suppose one want's to store it into a String,
to properly store it as a string it would be: "\"abcd\"" - while array would be as number - eg "1,2,3,4".
Now without IsArrayStr(or IsString) - this can't be done.

So, just adding a simple bit(or byte) would be enough,
eg instead of:
int                   type;
byte                type, arrString,nu1,nu2; (nu1/2 <=not-used)

One could also just add new type - eg ESC_ARRAYSTR.

arrString must be then possibly when setting EscValue - if it's string - marked arrString,eg in esc:
arr_string="abcd"; <=here - array should be marked arrString
arr=[1,2,"abcd",3,4]; <="abcd" should be marked as it already is(ESC_ARRAY) + arrString

And also adding it's check, eg:
IsArrayStr() - or just IsString().
GetString is not really needed to be added, but could be there.

EscValue would be then - perfect,
here just meaning it's fully self descriptive.


It's similar with IsNumber(can be double or int64) - but that is ok since has IsInt64(), and
if there would not be IsInt64 - it would be the same situation like with up array/string ambiguity.

[Updated on: Thu, 06 August 2026 00:57]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: A simple macro to run LazyGit for the active package via TheIDE
Goto Forum:
  


Current Time: Wed Oct 14 18:02:02 GMT+2 2026

Total time taken to generate the page: 0.15611 seconds