Link to home
Start Free TrialLog in
Avatar of ChLa
ChLaFlag for United States of America

asked on

using or with strings

I am trying to use a line like
"if string = '.bmp' or '.jpg' then
but I get
[DCC Warning] MAIN.PAS(376): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'

It also doesn't seem to work if I type
"if string = 'bmp' or if string = '.jpg' "then

how can I write this ?
ASKER CERTIFIED SOLUTION
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

if you want it cleaner, you can use AnsiIndexText

eg
if AnsiIndexText(lowercase(yourstring), ['.bmp', '.jpg']) >= 0 then
     //your stuff

Open in new window

Avatar of ChLa

ASKER

That worked...Thank You