Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Possible? Can I build and populate a UDT before Running a script

  1. #11
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    58
    Posts
    8,880
    Rep Power
    10
    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

  2. #12
    Member
    Join Date
    Jan 2013
    Age
    83
    Posts
    40
    Rep Power
    17
    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

  3. #13
    Member
    Join Date
    Jan 2013
    Age
    83
    Posts
    40
    Rep Power
    17
    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

  4. #14
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    58
    Posts
    8,880
    Rep Power
    10
    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

  5. #15
    Member
    Join Date
    Jan 2013
    Age
    83
    Posts
    40
    Rep Power
    17
    ' 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
    

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 6
    Last Post: 16-06-2025, 14:59
  2. Google Build (Lego)
    By John Spikowski in forum Development
    Replies: 0
    Last Post: 27-06-2012, 03:21
  3. Build your own OS?
    By kryton9 in forum Development
    Replies: 5
    Last Post: 17-01-2012, 09:18
  4. Aurel Basic v 1.1 build 85
    By zlatkoAB in forum Scripting
    Replies: 64
    Last Post: 04-05-2011, 22:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •