>> That's right. And for that you can test the object itself (which is 
 >> actually an alias). But once you put an object into a variable you need 
 >> another way to indicate whether its valid or not.

I agree, Bill. It could be very usefull, if there was a function in MapBasic 
that actual could test whether an object was legal or not/exists or was null, 
or what ever you want to call this state.
This is especially usefull when you have a function, that expects to get an 
object and also returns an object. How would you handle this situation ? What 
you make sure that you don't call the function with a not existing object, or 
could in some way handle the problem inside the function in a smart manner 
without corupting the table ?

I tend to check before calling the funtion, but would love to hear about a 
solution to the second if possible.

Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk/gis

"For enden af regnbuen..." - hvordan kommer man dertil og er det overhovedet 
muligt? 
Læs mere om årets MapInfo konference på www.cowi.dk/mapinfokonference

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Thoen
Sent: Friday, July 28, 2006 5:39 PM
To: Spencer Simpson
Cc: mapinfo-l@lists.directionsmag.com
Subject: Re: [MI-L] MAPBASIC Object or not Object?

Spencer Simpson wrote:

>No, I've found that aliases (especially objects) can act strangely if 
>you try to extract their values more than once between two successive fetches.
>Maybe newer versions of MapInfo are more robust, but it conditioned me 
>to always fetch aliases into variables back in the 1990s.
>  
>
I'd have to say, "Prove it." IMHO, that's a superstition that you develpoed as 
you were learning and now it's just a habit. It's similar to the superstition 
that using defined constants is not safe.

>Using "degenerate" objects to simulate null objects is useful, but it 
>doesn't help fetching them from a table, because you can't guarantee 
>that a row didn't have its object deleted.
>  
>
That's right. And for that you can test the object itself (which is actually an 
alias). But once you put an object into a variable you need another way to 
indicate whether its valid or not.

_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l




_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to