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!

When connected to a PABX the comman

Status
Not open for further replies.

iSDX

Technical User
Jul 24, 2002
64
AU
When connected to a PABX the command prompt is a "?"

When the user is not logged in and the user
Presses enter on the keyboard another "?"
appears. Eg
?
?

However if you are logged in and enter is pressed
You get the following.

?
Note the space!!! (Two linefeeds)
?

The question is can I differentiate between

0D 0A 3F and 0D 0A 0D 0A 3F

Using the When command



 
Hello

From the Help Pages the WHEN example could be modified as follows. I believe the Entire String is Evaluated Before an Action is Taken.

proc main
when TARGET 0 "0D 0A 3F" call Proc_1
when TARGET 1 "0D 0A 0D" call Proc_2
while $CARRIER ; Loop while connected.
yield ; Release ASPECT process time
endwhile
endproc

proc Proc_1
Do One Thing...
endproc

proc Proc_2
Do Something Else
endproc

Hank
 
Here's a script that shows how to wait for either sequence with two when target commands:

proc main
when target 0 "`x00D`x00A?" call proc1
when target 1 "`x00D`x00A`x00D`x00A?" call proc2
endproc

proc proc1
endproc

proc proc2
endproc
aspect@aspectscripting.com
 
Knob,

Just Curious.. Does the "`x00D `x00A?" denote a Hex Code for a Sequence ??

I'd just like to know.

Thanks

Hank
 
Yep, the `x00D is just ASPECT's way of representing hex 0D, or a carriage return, while `x00A = hex 0A = linefeed. I'm fairly certain I got the syntax right, but I did not double check it by running the script (the compiler liked it though).
aspect@aspectscripting.com
 
Just to let you know the syntax is correct. I tested the when command this morning
using the escape sequence and all tested ok.

Thank you both for your help.

Aspect reference : Escape sequences

When a "000" or "xhhh" sequence is used, it may consist of one to
three octal or hexadecimal digits ranging in decimal values from
0 to 255. Values greater than 255 will generate an error. It is usually
best to use all three digits, as in `004, since a letter or digit immediately
following an escape sequence may represent either an octal or hexadecimal
character which would then be interpreted as part of the escape sequence

 
Knob,

That helped in a Script I'm working on in a DMS 100 Switch, when in need to Transmit 2 CR's to get a CI prompt.

Hank Campbell
 
Another way to transmit the CR (probably would have worked for the when target as well) is to use ^M in your script. That's how you'll see a CR represented if you record a script using the Script Recorder.
aspect@aspectscripting.com
 
Knob

I tried that But the DMS Switch ignored it. Also I tried a "`%%^M". The DMS interperts a % as a Comment, and if you Send 2 %, the DMS will give a System Prompt. CI:

It was strange but it seems to have worked at Times ! Finally Tried the Following and it appears to work; but the results do not appear on the PC. Go Figure. I left out the Back Tick. The Pause helped but made no sence !

Transmit "%^M"
Pause 1
Transmit "%^M"
Pause 1
Waitfor "CI:" 5

But will Try your Example in the Morning and Let you Know.

Hank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top