🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8780

Re: condition compile in Java?

#8780
From: Ronald Wildenberg
Date: Mon, 26 Feb 2001 11:56
34 lines
2233 bytes
Hi,

I know that under Linux, there exists a program
called cpp (C Pre Processor), which you can also use on java programs
to generate source files with debug statements.

I do not know exactly how this works but I can use statements like
//@ DEBUG ("Variable i has value: " + i);

cpp transforms these entries into something like
Debug.log("Variable i has value: " + i);

You have to write a class Debug with appropiate methods and run cpp
on the version of the program you want to have debug statements in.
This method may be a little too much work, however, for a small project.

The advantage of this method is that once you get it working, you can
use it throughout your project and in every new project. Just import
the Debug class in all your source files.

I do not know whether something like cpp exists under Windows.

Ronald.

glisten liu wrote:

> Hi,everyone:
> I want to produce two version for a program, one is the running version and
> another is the debug version. I can use condition compile directs in c/c++.
> But it seems I can do nothing in Java?
>
> Thanks for help.
>
> glisten liu
Technical Details
Message-ID: <3A9A446E.904C1710@tryllian.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!zeus.visi.com!hermes.visi.com!news-out.visi.com!nycmny1-snh1.gtei.net.MISMATCH!cpk-news-hub1.bbnplanet.com!washdc3-snh1.gtei.net!news.gtei.net!feeder.qis.net!newsfeed.direct.ca!look.ca!newsfeed.icl.net!newspeer.clara.net!news.clara.net!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!bornews.borland.com!dnews!62.58.162.210
References: <3a99c43b_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,599cae576843a743
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-02-26 04:18:05 PST
Message-ID: <3A9A446E.904C1710@tryllian.com>
Date: Mon, 26 Feb 2001 12:56:30 +0100
From: Ronald Wildenberg <ronald@tryllian.com>
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: condition compile in Java?
References: <3a99c43b_2@dnews>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 62.58.162.210
X-Trace: 26 Feb 2001 03:54:27 -0800, 62.58.162.210
Lines: 35
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!zeus.visi.com!hermes.visi.com!news-out.visi.com!nycmny1-snh1.gtei.net.MISMATCH!cpk-news-hub1.bbnplanet.com!washdc3-snh1.gtei.net!news.gtei.net!feeder.qis.net!newsfeed.direct.ca!look.ca!newsfeed.icl.net!newspeer.clara.net!news.clara.net!colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!bornews.borland.com!dnews!62.58.162.210