Results 1 to 8 of 8

Thread: thinBasic_ParseString problem

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    thinBasic_ParseString problem

    Hi,

    the SDK for thinBASIC is great, but I have troubles with using thinBasic_ParseString statement. The DLL is compiled without problems, but it seems, that it captures null-lenght string...

    FUNCTION Exec_DemoFnc() AS EXT
        LOCAL dName AS STRING   , ldName AS STRING
        
        IF thinBasic_CheckOpenParens() THEN
            thinBasic_ParseString dName
                IF thinBasic_CheckCloseParens() THEN
                    dName = ldName
                    MSGBOX dname+ldName ' displays nothing
                    FUNCTION = 0
                END IF
        END IF
    
    
    END FUNCTION
    
    Any ideas?
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    thinBasic_ParseString problem

    The line "dName = ldName" will clear whatever string you parse because ldName is empty.

    So you should blank "dName = ldName" line.
    Also why are you declaring ldName variable if you do not use it?
    Or maybe it is the other way round: ldName = dName

    FUNCTION Exec_DemoFnc() AS EXT 
        LOCAL dName AS STRING   , ldName AS STRING 
        
        IF thinBasic_CheckOpenParens() THEN 
            thinBasic_ParseString dName 
            IF thinBasic_CheckCloseParens() THEN 
                MSGBOX dname
                FUNCTION = 0 
            END IF 
        END IF 
    END FUNCTION
    
    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

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    thinBasic_ParseString problem

    Such a silly bug

    Sorry, I had mixed it all in my head

    Thanks,
    Psch
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    thinBasic_ParseString problem

    When you will have time, tell me how is going on.
    I need to have some feedback on:
    [list][*]is it too much complicated?[*]are features missing?
    We already know about passing parameters BYREF, quite complicated in current development status. First we will have to add this feature in standard user defined functions.[*]any suggestion?[/list:u]
    Thanks
    Eros
    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. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    thinBasic_ParseString problem

    Hi,

    is it too much complicated?
    No, it isn't I like the concept. I was just thinking about simplification of IF/THEN/ENDIF nesting while testing params to something like:
    IF thinbasic_paramsok("(VVSV)", var1, var2, string1, var3) THEN
    
    <CODE IF PARAMS OK>
    
    END IF
    
    The first parameter is "mask" of parameters, where "()" means open/close parenthesis, "V" means value and "S" means string; the next parameters are variables, to which the params would be stored.

    But I think that way would be too unpractical/unapplicable for functions with optional params

    That's all for now

    Psch
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    thinBasic_ParseString problem

    Well, can be an idea but the problem is the sequence of the variables.
    I mean if the sequence is SSVV or VSVS or SV or VS how can I declare loacl internal variable or how can I call "thinbasic_paramsok" with all possible sequence of cases and types?

    Maybe AS ANY passing pointers to something?

    I will think about it.

    Thanks
    Eros
    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

  7. #7
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    thinBasic_ParseString problem

    Maybe it could be done with VARIANTs. But this is wrong way I think, the current style would be still better in terms of speed

    Let it be

    Thanks,
    Psch
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  8. #8
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    thinBasic_ParseString problem

    I would like to use VARIANTs too but in PB VARIANTs are only introduced to be managed by COM interfaces. If you use VARIANTs not for that purpose you will quite soon get troubles. At least this was my experience. I think PB has to improve VARIANTs type a bit more in order to be used as standard variable.

    Anyway I will take into consideration that option
    For the moment I will leave current SDK style.
    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

Similar Threads

  1. 6 thinBasic_ParseString calls: VariableGetInfoEx nulls
    By Charles Pegge in forum Basic language SDK development
    Replies: 8
    Last Post: 24-08-2008, 01:17

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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