|
Hi Georg,
Your main problem is that the DO IF command does _not_ prevent the ECHO command to execute. It is devoted to the transformation commands (COMPUTE, RECODE etc.) only.
Try:
do if (1 = 0).
- ECHO 'Eppur si muove' .
end if.
Strange, I agree. Keep smile.
Greetings
Jan
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Georg Maubach
Sent: Thursday, June 09, 2005 4:48 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Debugging of programs
Hi all,
we would like to use some sort of debugging mode in our programs. We
defined a macro
DEFINE @debug () 1 !ENDDEFINE .
and use it in a DO IF command. But this does not work. What are we doing
wrong?
Example:
DEFINE @debug () 1 !ENDDEFINE /* debug switched on */ .
DO IF (@debug = 1) .
ECHO 'Debugging Modus is on' .
ECHO 'Any debugging commands' .
END IF .
DEFINE @debug () 0 !ENDDEFINE /* debug switched off */ .
DO IF (@debug = 1) .
ECHO 'Debugging Modus is on' .
ECHO 'Any debugging commands' .
END IF .
Output:
Debugging Modus is on
Any debugging commands
Debugging Modus is on
Any debugging commands
In the latter case the text "Debugging Modus is on" and "Any debugging
comands" should not appear. How could we change it so that the debugging
commands are not run if the macro @debug is set to 0 with the command
DEFINE @debug () 0 !ENDDEFINE?
Best regards
Georg Maubach
Market Analyst
Deutsche Post World Net Business Consulting GmbH
Market Research Service Center
mailto:georg.maubach@dpwnbc.net
|