| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Rexx |
DONALD WOOLWINE had something deep to write about Rexx
DW> Hi I'm real new at programming and am trying my hand at a writing
DW> a few REXX programs. I have seem to run into a problem, I think. I am
DW> getting a stack full error after about 45 entries into a looping
DW> routine similar to the one that follows.
Replace all those 'Call's with 'Signal's, or learn to use if-then-else
constructs 'Signal' is REXX's version of 'GOTO'. If you want to use
subroutines, use 'Call's, but remember to add an occasional 'Return'
The 'return' causes execution to resume at the line after the 'call'.
An example of call and return is shown below:
/* REXX script called FACT.CMD */
/* computes factorials: try entering 'fact 6' from the command line */
/* try 'fact 10', 'fact 400' */
say factorial(arg(1));
call factorial arg(1);
say result;
exit 0;
factorial:
if arg(1)<2 then return 1;
else return arg(1)* factorial(arg(1)-1);
* KWQ/2 1.2g * Daniel, running slowly but surly on a motherless 386/25
--- QScan v1.12b / 01-0093
* Origin: La Cantina BBS * El Paso * 915-532-0332 6GB, 3 Nodes (1:381/123)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: 381/123 900 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™.