Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Fabien Bodard
2010/11/24 Demosthenes Koptsis demosthen...@gmail.com:

 hi,

 PRINT IsObject(NULL)

 returns
 TRUE

 The NULL constant is an object?

nead the help please !

http://gambasdoc.org/help/lang/isobject


 --
 Regards,
 Demosthenes Koptsis.


 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user




-- 
Fabien Bodard

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Benoît Minisini
 hi,
 
 PRINT IsObject(NULL)
 
 returns
 TRUE
 
 The NULL constant is an object?

NULL is almost everything. So IsObject(Null) and IsString(Null) returns TRUE. 
But IsDate(Null) returns FALSE, whereas Null can be a date.

So things are not very logical there.

-- 
Benoît Minisini

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Demosthenes Koptsis
sorry...

i ll be more careful next time.

On Wed, 2010-11-24 at 11:53 +0100, Fabien Bodard wrote:
 2010/11/24 Demosthenes Koptsis demosthen...@gmail.com:
 
  hi,
 
  PRINT IsObject(NULL)
 
  returns
  TRUE
 
  The NULL constant is an object?
 
 nead the help please !
 
 http://gambasdoc.org/help/lang/isobject
 
 
  --
  Regards,
  Demosthenes Koptsis.
 
 
  --
  Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
  Tap into the largest installed PC base  get more eyes on your game by
  optimizing for Intel(R) Graphics Technology. Get started today with the
  Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
  http://p.sf.net/sfu/intelisp-dev2dev
  ___
  Gambas-user mailing list
  Gambas-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/gambas-user
 
 
 
 

-- 
Regards,
Demosthenes


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Fabien Bodard
Le 24 novembre 2010 11:59, Benoît Minisini
gam...@users.sourceforge.net a écrit :
 hi,

 PRINT IsObject(NULL)

 returns
 TRUE

 The NULL constant is an object?

 NULL is almost everything. So IsObject(Null) and IsString(Null) returns TRUE.
 But IsDate(Null) returns FALSE, whereas Null can be a date.

 So things are not very logical there.

I think too .. as i can't use a null as an object so it is not an
object... but it depend if isobject test the variable type or the
content.

For exemple
dim o as object

isobject(o) will return true even if o is null... o can only be an object

but
dim v as variant

is object(v) will return false if it is null ... it can be anything


in my mind it will work like that ...



 --
 Benoît Minisini

 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user




-- 
Fabien Bodard

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Bruce Bruen
On Wed, 24 Nov 2010 06:51:50 pm Demosthenes Koptsis wrote:
 hi,
 
 PRINT IsObject(NULL)
 
 returns
 TRUE
 
 The NULL constant is an object?

I really don't see a problem here.  
Directly from the help:
IsObject 
Syntax
bRes = IsObject ( vRef ) AS Booelan
bRes = Object? ( vRef ) AS Boolean
Returns TRUE if the vRef is an object or a null reference.
IsObject(NULL) doesn't refer to the NULL constant being an object, it is 
answering correctly that a vRef=NULL is a null reference!

-- 
best regards
Bruce Bruen
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Demosthenes Koptsis
i will describe my thoughts about that,

i read the

http://gambasdoc.org/help/cat/constants

and i saw that a TRUE or FALSE value is a Language constant.
Also NULL is a Language constant!

So i expected from IsObject() to return FALSE when it is feed with
constants as argument.

So
PRINT IsObject(TRUE)   'False
PRINT IsObject(FALSE)  'False
PRINT IsObject(0)  'False
PRINT IsObject(a string) 'False

But
PRINT IsObject(NULL)   'True

Some more thoughts..
In wiki says that NULL is a void string
and indeed...

PRINT IsObject()  'True

1) But what if someone want to check a void string?
2) How a 
   PRINT IsObject(a string) 'is False
   and a 
   PRINT IsObject() 'is not False

both are strings and not Objects.


On Wed, 2010-11-24 at 12:21 +0100, Fabien Bodard wrote:
 Le 24 novembre 2010 11:59, Benoît Minisini
 gam...@users.sourceforge.net a écrit :
  hi,
 
  PRINT IsObject(NULL)
 
  returns
  TRUE
 
  The NULL constant is an object?
 
  NULL is almost everything. So IsObject(Null) and IsString(Null) returns 
  TRUE.
  But IsDate(Null) returns FALSE, whereas Null can be a date.
 
  So things are not very logical there.
 
 I think too .. as i can't use a null as an object so it is not an
 object... but it depend if isobject test the variable type or the
 content.
 
 For exemple
 dim o as object
 
 isobject(o) will return true even if o is null... o can only be an object
 
 but
 dim v as variant
 
 is object(v) will return false if it is null ... it can be anything
 
 
 in my mind it will work like that ...
 
 
 
  --
  Benoît Minisini
 
  --
  Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
  Tap into the largest installed PC base  get more eyes on your game by
  optimizing for Intel(R) Graphics Technology. Get started today with the
  Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
  http://p.sf.net/sfu/intelisp-dev2dev
  ___
  Gambas-user mailing list
  Gambas-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/gambas-user
 
 
 
 

-- 
Regards,
Demosthenes


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Benoît Minisini
 i will describe my thoughts about that,
 
 i read the
 
 http://gambasdoc.org/help/cat/constants
 
 and i saw that a TRUE or FALSE value is a Language constant.
 Also NULL is a Language constant!
 
 So i expected from IsObject() to return FALSE when it is feed with
 constants as argument.
 
 So
 PRINT IsObject(TRUE)   'False
 PRINT IsObject(FALSE)  'False
 PRINT IsObject(0)  'False
 PRINT IsObject(a string) 'False
 
 But
 PRINT IsObject(NULL)   'True
 
 Some more thoughts..
 In wiki says that NULL is a void string
 and indeed...
 
 PRINT IsObject()'True
 
 1) But what if someone want to check a void string?
 2) How a
PRINT IsObject(a string) 'is False
and a
PRINT IsObject() 'is not False
 
 both are strings and not Objects.
 

In Gambas, NULL and the void string are the same thing.

-- 
Benoît Minisini

--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Demosthenes Koptsis
On Wed, 2010-11-24 at 21:57 +1030, Bruce Bruen wrote:
 Returns TRUE if the vRef is an object or a null reference.
 IsObject(NULL) doesn't refer to the NULL constant being an object, it is 
 answering correctly that a vRef=NULL is a null reference!
 

yes i saw now the help about NULL reference or an object.

But IsObject(NULL) i think is different from IsObject(oMyNullObject)
The first is the constant the second is a NULL object.

Also see IsObject() which here is a empty string.

If i am wrong please correct me.

-- 
Regards,
Demosthenes


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Demosthenes Koptsis
On Wed, 2010-11-24 at 12:21 +0100, Fabien Bodard wrote:

 For exemple
 dim o as object
 
 isobject(o) will return true even if o is null... o can only be an object
 
 but
 dim v as variant
 
 is object(v) will return false if it is null ... it can be anything

hm... i checked this in Gambas2-2.21

DIM v AS Variant = NULL

PRINT IsObject(v) 'True

i see that, if something is NULL is recognized as object anyway.

-- 
Regards,
Demosthenes


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] IsObject(NULL)

2010-11-24 Thread Demosthenes Koptsis
On Wed, 2010-11-24 at 21:57 +1030, Bruce Bruen wrote: 
 I really don't see a problem here.  
 Directly from the help:
 IsObject 
 Returns TRUE if the vRef is an object or a null reference.
 IsObject(NULL) doesn't refer to the NULL constant being an object, it is 
 answering correctly that a vRef=NULL is a null reference!
 

ok, may be Bruce is right here,

NULL can be a reference to a NULL object but also a Variant or a Dynamic
array or anything with a NULL reference.

So IsObject() cannot determine the reference to object but to a NULL
reference.

i was just thinking if there is a way the IsObject() can be more
accurate if something is NULL object or anything else.

I was thinking
if it was a NULL object, ok it is an object
If it was anything else NULL, is not an object

for example

DIM aStrings AS String[] 'is a null object
PRINT IsObject(aStrings) 'True

DIM v AS Variant = NULL
PRINT IsObject(v) 'here i expected false

i tried to determine this difference with TypeOf

DIM aStrings AS String[] 'is a null object
PRINT TypeOf(aStrings)  'but i get 15 NULL value

DIM v AS Variant = NULL
PRINT TypeOf(v) 'again 15 NULL value instead 11

so i think there is no way to make difference of objects or anything
else if they are NULL.


-- 
Regards,
Demosthenes



--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user