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!

Trouble with the WHEN command

Status
Not open for further replies.

pragmatic

Programmer
Aug 23, 2001
31
US
I'm having trouble getting WHEN to work..

when target 0 "SYSB-T" MATCHCASE call test
when target 0 "INSV" MATCHCASE call test1
when target 0 "OFFL" MATCHCASE call test2

calling these functions:

proc test
strcpy strResult "**System-Busy**"
fseek 1 (-2) 1
finsblock 1 16
fwrite 1 strResult 16
fseek 1 2 1
endproc

proc test1
strcpy strResult "**In-Service**"
fseek 1 (-2) 1
finsblock 1 15
fwrite 1 strResult 15
fseek 1 2 1
endproc

proc test2
strcpy strResult "**Off-Line**"
fseek 1 (-2) 1
finsblock 1 12
fwrite 1 strResult 12
fseek 1 2 1
endproc

Here's what the data string looks like:

0 TRUNKS HOST 0 1 - 15 1 11 INSV m.


I need the MATCHCASE to work, there are times where lowercase values show up, but I don't want to trigger off of them.

Thanks
 
You need to make sure that each when target command references a different id (i.e. when target 0 ... , when target 1 ... , and so forth). Since you have when target 0 ... defined three times, only the last command actually is set and the previous two when commands are not active.


aspect@aspectscripting.com
 
Ah, I see now. That would explain the results I was having.. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top