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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rget help file confusion 2

Status
Not open for further replies.

mjg01

Programmer
Nov 22, 2002
7
US
Does anybody else find the help file topic for rget a bit confusing? It mentions the need to use two rget commands when rgetchar is a carriage return. The first rget command gets the carriage return and the second rget command gets the actual message, since rget ends as soon as it encounters a carriage return. It doesn't make sense why the first rget command would return the carriage return and the second the actual message. It seems like it should be the reverse.

mjg
 
It depends on the system that you are connecting and how your script is architected. If you transmit a command to a remote system, chances are that command (and the trailing carriage return) will be echoed back to Procomm, so in that case you would need a second rget to get the actual data returned by the command.

aspect@aspectscripting.com
 
Thanks. How about this situation: A client is sending me a password with a carriage return. Will I still need two calls to rget? Will the first call to rget be the password, and will it contain the return? Assuming neither they nor I have sent anything else.

Thanks,

mjg
 
Is the carriage return part of the password itself and then will be followed by a second carriage return marking the end of the line? If so, I would check to see if there is a different line terminator (such as a linefeed) that is sent at the end of each line and then configure Procomm to look for a linefeed via the set aspect rgetchar command. You can use Procomm's monitor window to see what data is being sent by the other system. Here is some more information on it from my site:

Procomm's Monitor Window can be used to view the incoming and outgoing data, in both hex and ASCII format. To activate this window, select the Data | Monitor Window menu item. Resize the Monitor Window so that you can view the entire width of the window, then click back in the Procomm Plus window so that the Monitor Window does not have focus. Incoming text is displayed in red, while text you send is colored blue. The Monitor Window can be handy for viewing incoming escape sequences (to determine if Procomm Plus is responding properly to them) or to verify that the program is sending the data you think it should be.

In your case, you want to be looking for a red OD (which is a carriage return) and a red 0A (which is a linefeed).


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top