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