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!

RGET and Array problem

Status
Not open for further replies.

bonk33r

Technical User
Sep 22, 2004
7
US
When I run the following script I get the error "001 Value out of range" after 30 seconds. If I take out the array and make sMES a normal variable it works fine.

Any ideas?

Thanks,
Bonk

proc main
string sMES[3]
integer Loops
transmit "MES^M"
Loops = 0
while (Loops++) < 3
while nullstr sMES[Loops]
rget sMES[Loops]
yield
endwhile
endwhile
endproc
 
What is happening is that you declared three members of the array, but you are trying to access the fourth (sMes[3]). If you are expecting four lines of input, then you will need to change your array declaration to be:

string sMES[4]

aspect@aspectscripting.com
 
Knob,
Thanks for the quick reply! Just for grins and giggles I changed string sMES[3] to string sMES[10] and still received the same error.

Thanks,
Bonk
 
Ok, I leaned the script down to this:

proc main
string sMES[10]
rget sMES[1]
endproc

I've tried running it on my desktop and laptop. On both I get the "001 Value out of range" error.

When I run this script:

proc main
string sMES
rget sMES
endproc

It runs with no errors. I've been searching through this forum and all the examples I can find and have yet to see where anybody has used an array with an RGET. Does anybody have a working example of this?

Thanks,
Bonk
 
I tried your latest script on my NT machine running version 4.7 and it worked fine as well. My next step would be ro rename your parameter file in case you have any corruption in that file, which sometimes causes "odd" things to occur. Go to the main directory of your Procomm install, rename PW4.PRM to something different, and restart Procomm. You will get a couple dialogs to reset some of your settings, then the program should be up as before. Try running your script then and see if it works as expected.


aspect@aspectscripting.com
 
FWIW.... I also have 4.7 and I tried his script and get the same error !
 
I reran this with version 4.7 on XP and do see the crash. Not sure why my NT machine at home didn't act the same way, although I wasn't making a connection like I was at work (no network connection on the old machine at home). My guess is that this is a bug in 4.7 that was fixed in 4.8 as I tried running Procomm in NT compatibility mode under XP and still saw the crash. FYI, the script worked OK on my XP machine with 4.8 as well.


aspect@aspectscripting.com
 
Well since this script has the possibility to go to over 120 offices that have the same OS and version of Procomm, I found a work around.

proc main
string sMES[4],sTemp
integer Loops
transmit "MES^M"
Loops = 0
while (Loops++) < 3
while nullstr sTemp
rget sTemp
sMES[Loops] = sTemp
yield
endwhile
endwhile
endproc

Hope other people in my situation find this useful also.

Thanks,
Bonk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top