|
Hi Georg,
It was not a solution, it was a demonstration of the problem only. The soulution would be to define two macros:
DEFINE @echo ().
!if (!eval(@debug) !eq 1) !then .
echo 'Here am I !'.
!ifend
!ENDDEFINE .
DEFINE @debug () 1 !ENDDEFINE .
@echo .
DEFINE @debug () 0 !ENDDEFINE .
@echo .
The macro @echo says 'Here am I !' only if the macro @debug is on (=defined as 1).
Greetings
Jan
-----Original Message-----
From: Georg.Maubach@dpwnbc.net [mailto:Georg.Maubach@dpwnbc.net]
Sent: Thursday, June 09, 2005 5:04 PM
To: Spousta Jan
Cc: SPSSX-L@LISTSERV.UGA.EDU
Subject: ***SPAM*** AW: Re: Debugging of programs
Hi Jan,
thanks for your reply. It try your proposed solution, but unfortunately the outcome was the same as without "-".
Any ideas why this does not work on my machine?
Regards
Georg Maubach
e-Mail Georg.Maubach@dpwnbc.net
-----Ursprüngliche Nachricht-----
Von: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] Im Auftrag von Spousta Jan
Gesendet: Donnerstag, 9. Juni 2005 17:00
An: SPSSX-L@LISTSERV.UGA.EDU
Betreff: Re: Debugging of programs
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
|