I think I'm going to run with this method until it shows a problem. It seems very flexible, many thanks for pointing it out.
George
Great George, very happy I can help.
I think with this method you can add very nice new features to your application.
It is quite flexible and let you create any level of dotted notation pseudo objects
thinBasic has other methods to add more real OOP objects, maybe I can give you additional info/examples on how to do it
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
I think I'm going to run with this method until it shows a problem. It seems very flexible, many thanks for pointing it out.
George
Eros: I doubt this is possible but...
I've created a Grp.Name function (sample code shown previously) returning a STRING. Even if used as A = Grp.Name, where A is a NUMBER, it works, no errors are reported.
But I have numerous flag variables that return ON or OFF. If accidentally used in numeric manner (i.e. IF Grp.Name) , both ON and OFF return 0 (zero)
Is there a way to 'know' the format of the recipient of my functions return value? If so, I could make ON/OFF style flags return 1/0 (in string form)
Not a show stopper, but it would help avoid the Oops type errors.
George
Can you please make a little script example using Grp.Name so I can better understand?
There can be different road to go depending on how to used.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
' Try.MACRO SPF_Trace(off) dim i as long dim s as string s = FIL.Hex ' s would receive either 'ON' or 'OFF' i = FIL.Hex ' i would receive 0, ' since the conversion to numeric yields 0 ' If I knew the receiving variable was numeric ' I would return a '1' or '0' instead, then ' a test like IF ISTRUE FIL.Hex would work properly