Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSTR problem

Status
Not open for further replies.

KevinFord2003

Technical User
Dec 27, 2002
3
US
Hi all, got a strange problem with Instr$...

In the code below, the first line with Instr
works as expected. However, the next nested
instr test always fails, even when the search term is present. This is driving me nuts...Anyone know of a solution??

Thanks in advance!!
Here's the code:

DO
LINE INPUT #1, InLine$
InLine$ = LTRIM$(LCASE$(InLine$))
IF INSTR("begin polygon", InLine$) THEN
DO
LINE INPUT #1, InLine$
InLine$ = LTRIM$(LCASE$(InLine$))
' Next line ALWAYS fails
IF INSTR("vertex", InLine$) THEN
' Deal with it
END IF
LOOP WHILE done = 0
END IF
LOOP WHILE NOT EOF(1)
 
flip your arguments


DO
LINE INPUT #1, InLine$
InLine$ = LTRIM$(LCASE$(InLine$))
IF INSTR( InLine$,"begin polygon") THEN
DO
LINE INPUT #1, InLine$
InLine$ = LTRIM$(LCASE$(InLine$))
IF INSTR( InLine$,"vertex") THEN
beep
END IF
LOOP until done
END IF
LOOP until EOF(1) Sometimes... the BASIC things in life are the best...
cheers.gif

or at least the most fun ;-)
-Josh Stribling
 
Doh!! Well I fell stupid. Thanks!
This is what I get for messing with basic after not using it for a few years.

Of course the REAL question is why the heck am I using Qbasic to write a program to convert Unreal levels into a new format?? :)
 
No Prob...
I know the feeling...
TRUST ME ;-)
Sometimes... the BASIC things in life are the best...
cheers.gif

or at least the most fun ;-)
-Josh Stribling
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top