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!

regular expressions

Status
Not open for further replies.

efittery

Programmer
Feb 13, 2003
21
US
When I issue a command to my BCB ( a medical diagnostic machine ) I can get back a varied response:

As an example I use the following:

waitfor("GuiInit state=INITIAL rc=0 sentTo
=GUIBOX replyTo=<none> sender=EXEC type=2 value=0&quot;) even though I am only interested that the string that is waited on has:

1. &quot;GuiInit&quot;
2. &quot;sender=EXEC&quot;
3. &quot;type=2&quot;
4. &quot;value=0&quot;

in the return string.

If I was using unix/perl/tcl etc, I would use the regular expression &quot;GuiInit*sender=EXEC*type=2*value=0&quot; or at least something like it.

Actually, ASPECT is starting to grow on me. Too bad there isn't much of a demand for contracting ( am I wrong about this impression ) people using ASPECT.

 
Well maybe that isn't so bad considering the economy is so bad - or should I say that there are so few jobs and so many H-1B programmers working in the USA and so many companies outsourcing their work to India.

Did you know that a genius type PhD software guru in India makes about $16,000 a year and lives very well on that kind of salary.

sorry about that, I am off the topic...
 
I find it best to handle varied responses using when statements rather than a waitfor.

Code:
proc main
   integer active = 1
   when target 0 &quot;GuiInit&quot;     call page1
   when target 1 &quot;sender=EXEC&quot; call page1
   when target 2 &quot;type=2&quot;      call page2
   when target 3 &quot;value=0&quot;     call page2
   when target 4 &quot;all done&quot;    call done
   while active
      yield
   endwhile
endproc

proc page1
   transmit &quot;XXX^M&quot;
endproc

proc page2
   transmit &quot;YYY^M&quot;
endproc

proc done
   when clear
   active = 0
endproc

 
Has anybody got a .dll that would support using regular expressions when doing a &quot;waitfor&quot; or a &quot;when target&quot;?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top