I am trying to use the set aspect rgetchar to terminate the rget command, I have set the rgetchar to 63 "?"
and have check this by using the fetch command. Unfortunately the script doesn't following this instruction.
I have checked the incoming string by using the command strchr to check if the remote system has sent a "?" and this proves true. The remote system is a PABX and the command prompt is "?" The script works fine with a time delay, but ever system has a different time delay before giving the command prompt, to enter the next command.
Unfortunately I am not a programmer and would appreciate any help on this issue.
here is the part of the script which is in question.
i=0
While not nullstr table_namearray ;Loop while array elements !=0
Transmit "xa "
Transmit Table_Namearray
Transmit " " ;Send command to the PABX
Transmit SPLEI
Transmit " 1 o 0"
Transmit "^M"
Rget iSDX_ECHO 80 5 ;ignore ECHO back from the PABX of ;the above command
fetch aspect rgetchar bla
;usermsg "%d" bla
set aspect rgetchar 63 ;terminating char for rget set to" ?" ;63 ascii
fetch aspect rgetchar bla
;usermsg "%d" bla
While 1
Rget VALUE 28 forever raw ;Get data,place in string value, ;timeout if ? is recieved
Substr Offset_Str VALUE 14 4 ;Strip value and place require string ;in Offset_str
atoi Offset_Str Offset_cnt ;Convert Offset_str to an integer, ;base 10.
DIVarray[offset_cnt] = 1 ;Place one in the array index define ; by Offset_cnt
If failure
Exitwhile
endif
Endwhile
i++ ;Bump up ;table_namearray index
Endwhile
and have check this by using the fetch command. Unfortunately the script doesn't following this instruction.
I have checked the incoming string by using the command strchr to check if the remote system has sent a "?" and this proves true. The remote system is a PABX and the command prompt is "?" The script works fine with a time delay, but ever system has a different time delay before giving the command prompt, to enter the next command.
Unfortunately I am not a programmer and would appreciate any help on this issue.
here is the part of the script which is in question.
i=0
While not nullstr table_namearray ;Loop while array elements !=0
Transmit "xa "
Transmit Table_Namearray
Transmit " " ;Send command to the PABX
Transmit SPLEI
Transmit " 1 o 0"
Transmit "^M"
Rget iSDX_ECHO 80 5 ;ignore ECHO back from the PABX of ;the above command
fetch aspect rgetchar bla
;usermsg "%d" bla
set aspect rgetchar 63 ;terminating char for rget set to" ?" ;63 ascii
fetch aspect rgetchar bla
;usermsg "%d" bla
While 1
Rget VALUE 28 forever raw ;Get data,place in string value, ;timeout if ? is recieved
Substr Offset_Str VALUE 14 4 ;Strip value and place require string ;in Offset_str
atoi Offset_Str Offset_cnt ;Convert Offset_str to an integer, ;base 10.
DIVarray[offset_cnt] = 1 ;Place one in the array index define ; by Offset_cnt
If failure
Exitwhile
endif
Endwhile
i++ ;Bump up ;table_namearray index
Endwhile