TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Donald Woolwine
from: Billy O`connor
date: 1994-10-22 04:47:00
subject: Rexx

>@MSGID: 1:282/4054 5444c202
 >@PID: RA 2.02 22424
 >@TID: FastEcho 1.40 7843

 >error after about 45 entries into a looping routine similar to the one that
 >follows.
 >call rxfuncadd 'SysGetKey', 'RexxUtil', 'SysGetKey'
 >M1:
 >Say 'Press any key to continue'
 >key = SysGetKey(noecho)
 >IF key='r'
 >   THEN
 >     CALL R1
 >   ESLE CALL T1
 >IF key='R'
 >   THEN
 >    CALL R1
 >   ESLE CALL T1
 >R1:
 >SAY " You entered "'R'
 >call M1
 >T1:
 >SAY " I DON'T UNDERSTAND, TRY AGAIN"
 >CALL M1
 >After about 45 keyboard entries I get the following error message.
 >Call
 >R1;
 >REX0011: Error 11 running C:\CMD\testhot.cmd, line 10: Control stack full

You're recursively calling the main function at the bottom of the called
sub-functions here, Don.  The control stack has to keep track of all the
functions that were called and haven't returned yet, but these guys
ain't never comin' back.  The way you have this set up would work, though, 
in a regular .CMD or .BAT file, with goto's instead of calls.  
For a Rexx program try something like this:
/*****************************************************/
call rxfuncadd 'SysGetKey', 'RexxUtil', 'SysGetKey'

do forever
	Say 'Press any key to continue'
	key = SysGetKey(noecho)
	if key='r' then
     		call R1
	else if key = 'q' then
		call quit	
	else
		call T1
end

R1:
	say " You entered "'r'
return

T1:
	say " Huh?"
return
quit:		/* Just fall out here */
/**************************************/


___
 * MR/2 2.05 NR * billyoc{at}netcom.com

--- QScan v1.131b / 01-0164

* Origin: PandA's Den BBS * Danvers, MA * 508-750-0250 * Node 1 (1:330/204)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 942 949 712/353 623 713/888 800/1
@PATH: 330/204 176 3615/50 229/2 12/2442 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.