vendredi 11 septembre 2020

BASIC IF THEN using Like

I am currently trying to write an IF/THEN statement in BASIC but none of the 6 relational Operators seem to help me. I want to compare a variable (srName) and if it contains the letters TS I want the relevant statements to play out.

From what I can see LIKE doesn't work in BASIC so i was just wondering if anybody knows an alternative for contains or begins with.

Just to add the bit of the code below for anyone that wants to see it. I have currently left LIKE in there to show what I want it to do. I know it won't work as is with that condition. The only line that is broke is the first one.

IF srName LIKE %TS% THEN
    status = ChangeSpec(result, 'T')
    return newDate
ELSEIF srName LIKE %SD% THEN
    status = ChangeSpec(result, 'F')
    return newDate
ELSE
    return ""
ENDIF

Aucun commentaire:

Enregistrer un commentaire