check a string for a '-' char
Posted in 2008
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
What is the function called that would indicate the presence of a certain character in a string variable. define myName char(20) # Looking for a dash in a name if (strstr(myName, "-")) then message "My name has a dash" else message "My name has a dash" end if I'm guessing the code would be something like this, but the 4gl specifics are not known to me. Thanks for the help.
monkeys paw wrote: > What is the function called that would indicate the presence of > a certain character in a string variable. > > define > myName char(20) > > # Looking for a dash in a name > > if (strstr(myName, "-")) then > message "My name has a dash" > else > message "My name has a dash" > end if > > I'm guessing the code would be something like this, but the > 4gl specifics are not known to me. Thanks for the help. Check LIKE and MATCHES in the 4GL manual Regards. -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently...