Options

How can a String expression be evaluated? example '2+5>5'

FCPFCP Member Posts: 36
How can a String expression be evaluated? If I have a String Variable
like '2+5>=5' and I whan't to check if it's true how can i do it?

Any ideas?

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Have a look at the download section:
    Mathematical Expressions Parser
    Calc
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • FCPFCP Member Posts: 36
    Luc, Unless I'm wrong the return of those will be a number. What I wan´t is something to return 'true' or 'false', depending if the expression if true or false. Something that checks if a string is part of "Filter"


    Function('23234','23*') would return true

    Is this possible?
  • azwierzchowskiazwierzchowski Member Posts: 15
    Use Microsoft Script Control.

    VariantVal : Variant
    Script: Automation 'Microsoft Script Control 1.0'.ScriptControl"

    CREATE(Script);
    Script.Language := 'VBScript';
    VariantVal := Script.Eval('2+5>=5');
Sign In or Register to comment.