TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Ruud Senden
from: Darin McBride
date: 1996-01-02 22:49:04
subject: REXX syntax-checker

Hello Ruud!

02 Jan 96 18:24, Ruud Senden wrote to All:

 RS> Hello All,

 RS> I am writing a REXX-program of which some parts are almost never
 RS> executed (for example, some parts are only executed when a
 RS> certain error occurs, but the particular error is difficult to
 RS> generate). Since REXX only checks for (syntax-)errors while
 RS> executing the program, those parts are not tested for
 RS> syntax-errors.

 RS> Does anybody know whether is is possible to test those parts (or,
 RS> in general, the whole REXX-program) for syntax-errors? Does

Not knowing the size/scope of the application, but since it's in REXX it
shouldn't be too big (otherwise you'd want to move to a faster language),
try using a trace ?r right before you hit the area where you COULD run into
the problem.  Then trace through and change the variables in question to
FORCE the 'error'.  This would require you to always get a result before
testing it rather than testing against something during the 'if'.

For example, if you have a statement such as:

if SysFunctionToTestError() \= 0 then do
  /* something */
end

you would have to change it to:

rc = SysFunctionToTestError()
if rc \= 0 then do
 /* something */
end

so that you can stop before the if statement is executed to change rc to 0.

This is as close to 'complete code-coverage' as many programs can get.
Hopefully this helps, even if only in principle.  :-)

(Having VXREXX would allow you to use breakpoints, etc., even on non-visual
programs.)

Darin McBride

--- GoldED/2 2.42.G0614
* Origin: Tanktalus' Tower BBS/RPGs Galore! (1:342/708)
SEEN-BY: 270/101 620/243 711/401 409 410 413 430 808 809 934 955 712/407 515
SEEN-BY: 712/517 628 713/888 800/1 7877/2809
@PATH: 342/708 5015 61 270/101 712/515 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™.