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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compairing in an IF statement

Status
Not open for further replies.

Woodro

Technical User
Jul 31, 2002
78
US
How do I make this work? I'm trying to see if the user input the word NPA, NXX or SPN back earlier in program.These would be assigned to the bartype veriable.
I'm trying to say IF strfind bartype is NXX or NPA or SPN then do this? with one if then statement. Is this possible or is there a better way. I'm sure this is simple but I'm just learning.I can't figure this out.
Thanks!!

sdlginput "Gathering Information..." "Enter the either NPA,NXX or SPN :" bartype 3 DEFAULT
if FAILURE
goto Quit
else
endif
if strfind bartype "NPA"|"NXX"
sdlgmsgbox "" "Do you have Deny codes?" question yesno denycode
if denycode == 6
sdlginput "In the format C:\file\denycodes.txt" "Enter the text file they are stored in." storedfile DEFAULT

else
endif
endif

Woodro
 
The best way to do that is with a switch/case statement, something like this should work:

switch bartype
case "NPA"
case "NXX"
case "SPN"
sdlgmsgbox "" "Do you have Deny codes?" question yesno denycode
if denycode == 6
sdlginput "In the format C:\file\denycodes.txt" "Enter the text file they are stored in." storedfile DEFAULT
endif
endcase
endswitch

aspect@aspectscripting.com
 
Ok,
Thanks a bunch, I'll work on that a while.

Woodro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top