IF isvalid(object_a) AND isvalid(object_b) THEN
object_a.of_function(object_b)
END IF
code something like this:
if ( isvalid(object_a) and not(isNull(object_a)) ) and (isvalid(object_b)
and not(isNull(object_b)) ) then
object_a.of_function(object_b)
end if
Regards
Csaba Toth
--
Csaba Toth
Programmer [Development]
cs...@addease.com.au
Addease Pty. Ltd.
P.O. Box 1484
COLLINGWOOD VIC 3066
Australia
Ph : +61 3 9416 2944
Fax: +61 3 9416 2580
web: http://www.addease.com.au
-- Tim
The logical condition is an AND man!
That means the entire condition has to be true in order for the test to evaluate
to true.
It makes no differece wich way PB evaluates anything. It could do it backwards!
The code works correctly, that is, you will NOT get a Null object reference!
Look up BOOL Algebra!!
Regards
Csaba Toth
Robert
On top of which, you shouldn't ever need to check an object reference variable
using IsNull ( ). The IsValid ( ) should be used to validate the existence of
objects.
---
Craig Wagner | E-mail: cwa...@metacorp.com
CPD Professional | Web: http://www.metacorp.com
Certified Powersoft Instructor | Phone: (503) 452-6343
Portland, OR USA |
Keeper of the PowerBuilder FAQ
http://www.teleport.com/~wagnerc/powerbuilder_faq.html
if IsValid(u_something) and u_something.uf_function() = TRUE.../
will fail if u_something is not valid (has not been created).
I suppose this is what Tim was getting at.
Simon
Csaba Toth wrote in message <3659EDD1...@addease.com.au>...
To the other Tim,
Whether there is a specific order in evaluation or not, doesn't really
matter - coding for the order is not good programming. You should
NEVER depend on the internal processes of the language - they can
change from version to version making your code version specific -
very bad for maintenance.
On Mon, 23 Nov 1998 17:47:59 GMT, cwa...@metacorp.com (Craig Wagner)
wrote:
>Robert Martincic <rmar...@bju.edu> wrote:
>
>On top of which, you shouldn't ever need to check an object reference variable
>using IsNull ( ). The IsValid ( ) should be used to validate the existence of
>objects.
>
>>Powerbuilder doesn't use short-circuit Boolean evaluation so the order shouldn't
>>matter.
>>
>>Robert
>>
Boolean. Returns a boolean value indicating whether objectname has
been created. If objectname is NULL, IsValid returns NULL.
If IsValid() returns NULL, then it doesn't fail the if condition. You
need to check IsValid AND IsNull to ensure you're not going to get
null object references.
Ken
On Tue, 24 Nov 1998 10:22:08 -0000, "Simon Caldwell"
<simonATgetrealsystemsDOTcom> wrote:
>Well it's true that
>
>if IsValid(u_something) and u_something.uf_function() = TRUE.../
>
>will fail if u_something is not valid (has not been created).
>I suppose this is what Tim was getting at.
>
>Simon
>
>Csaba Toth wrote in message <3659EDD1...@addease.com.au>...
>>I'm sorry, I'm lost for words.
>>
>>