PDA

View Full Version : Searching for semicolon in string



rogc742
06-29-2004, 04:12 PM
I need to check that an INI file is correctly configured during an installation. By default the string exists but is commented by a semicolon (";") in the first position. I've attempted to use the following to find if the string remains commented:
if ( strvar % ";" ) then ...
This search will fail. The question is, how can I determine whether this line in the file has a semicolon?
Thanks,
Roger

JOAT-MON
06-29-2004, 07:07 PM
FileGrep ( szFileName, szSearchStr, svReturnLine, nvLineNumber, nFlag );

rogc742
06-30-2004, 08:09 AM
Well, what I've been trying to do is filegrep for the line I need to check. Then I'm trying to check for the presence of the semicolon. I suppose what you're suggesting is that I check for the entire line including the semicolon and I've considered that method. My problem with the approach is that is someone has reformated the file in some way, I wouldn't be able to find the line. For instance, by default the line is ";string". If they were to reformat the line as "; string" I wouldn't find it.

Roger

rogc742
06-30-2004, 02:50 PM
Problem resolved. Syntax error.