In Starbasic Macros, in LibreCalc, I cant make a string to be passed as expression

In Starbasic Macros, in LibreCalc, I cant make a string to be passed as expression

  • splitColours(1) returns the name of string
  • cLightYellow returns the value of the variable

How I convert String as an expression ?

     cLightYellow    = RGB(24,194,205)
     cLightPurple    = RGB(224,194,205)
     cLightGreen     = RGB(175,208,149)
     cBlue           = RGB(114,159,207)
     cOrange         = RGB(232,162,2)
     cGreen          = RGB(63,175,70)
     cBlack          = RGB(49,64,4 )

Const oColours = "cLightYellow|cLightPurple|cLightGreen|" _
                   & "cBlue|cOrange|cGreen|cBlack"                                         
splitColours   = Split(oColours, "|")

print splitColours(1) returns the name of string
print cLightYellow returns the value of the variable

DONT DO IT.
It doesnt work!
it would be evil in case it works as you may expect!
its unneccessary because the Color_names are already defined!

So, what to do?

I need to define the colours with names. Then I need to call them as 1st, 2nd, 3rd element.

Is it possible in a way to iterate eg. through function through them and to use them in that way?

acolors = array( cLightYellow , cLightPurple , '#…etcpp…'
mycolor = acolors(2)
1 Like