TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Donald Woolwine
from: Bob Swift
date: 1994-10-22 09:20:16
subject: Re: Rexx

Friday October 21 1994 00:55, Donald Woolwine wrote to All:

 DW>  Hi I'm real new at programming and  am trying my hand at a
 DW> writing a few REXX programs. I have seem to run into a problem, I
 DW> think. I am getting a stack full error after about 45 entries
 DW> into a looping routine similar to the one that follows.

Your problem is that you are recursively "call"ing the routines
rather that simply jumping to them (using the "signal" command).

Re-written (and optimized a little), your program would be:

/*  TESTHOT.CMD   --  testing out hotkeys */
call rxfuncadd 'SysGetKey', 'RexxUtil', 'SysGetKey'
M1:
Say 'Press any key to continue'
key = SysGetKey(noecho)
IF ((key='q') | (key='Q')) THEN EXIT        /* Quit option */
IF ((key='r') | (key='R')) THEN SIGNAL R1   /* combined for brevity */
SAY " I DON'T UNDERSTAND, TRY AGAIN"
SIGNAL M1
R1:
SAY " You entered 'R'"
SIGNAL M1


For what it's worth, there was no clean way to exit the program either.  I
included an extra check for a "Q" to allow you to quit
gracefully.

Bob

--- GoldED/2 2.42.G0614+

* Origin: The Power Station * (403) 963-1859 * (1:342/5)
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: 342/5 504 61 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™.