Skip to main content



      Home
Home » Archived » BIRT » is empty (isempty) or similar function
is empty (isempty) or similar function [message #157742] Tue, 02 May 2006 05:42 Go to next message
Eclipse UserFriend
Originally posted by: vs.inser.ch

Hello,

I'd like to test a variable : if it is null, I assign a value to him
("toto", for example).
My scipt functions very well. Ex :

test=null;

if(test==null) {
test = "toto";
}


But[...] if the variable is not null but undefined, how can I program "
if test is undefined, I defined it and assign value "toto" ? "

Thanks.
Re: is empty (isempty) or similar function [message #157873 is a reply to message #157742] Tue, 02 May 2006 14:27 Go to previous messageGo to next message
Eclipse UserFriend
You can put in

if( xyz == undefined ){

xyz = "isdefined now";

}

But xyz has to be declared somewhere as

var xyz;

For example put it in the initialize script.

If you do not do this you will get a runtime error as per the Rhino docs.



Jason

"Mika
Re: is empty (isempty) or similar function [message #157912 is a reply to message #157873] Tue, 02 May 2006 16:53 Go to previous message
Eclipse UserFriend
Originally posted by: vs.inser.ch

It's ok.

Thanks !
Previous Topic:Preview as PDF
Next Topic:How to run a report in Birt
Goto Forum:
  


Current Time: Tue Jul 22 19:14:30 EDT 2025

Powered by FUDForum. Page generated in 0.03305 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top