LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 9 Jun 2005 17:12:50 +0200
Reply-To:   Spousta Jan <JSpousta@CSAS.CZ>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Spousta Jan <JSpousta@CSAS.CZ>
Subject:   Re: Debugging of programs
Comments:   To:
Content-Type:   text/plain; charset="ISO-8859-1"

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).



-----Original Message----- From: [] 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?


Georg Maubach e-Mail

-----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.


do if (1 = 0). - ECHO 'Eppur si muove' . end if.

Strange, I agree. Keep smile.



-----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

Back to: Top of message | Previous page | Main SPSSX-L page