Hi Tim,

I’ve been bitten by this a while ago. There is a difference in behavior 
interpreted and compiled. Eg following piece of code:

 1 C_OBJECT($obj)
 2 C_TEXT($text)
 3 C_LONGINT($long)
 4
 5 OB SET($obj;"property";"value”)
 6
 7 $text:=OB Get($obj;"nonexistent")
 8 $text:=OB Get($obj;"nonexistent";Is text)
 9
10 $long:=OB Get($obj;"nonexistent")
11 $long:=OB Get($obj;"nonexistent";Is longint)
12
13 ON ERR CALL("Errorhandler")
14 $long:=OB Get($obj;"nonexistent")
15 $long:=OB Get($obj;"nonexistent";Is longint)
16 ON ERR CALL(“”)

Interpreted: no error on lines 7 and 8, error on line 10 (54 - Argument types 
are incompatible)
no error on line 14, but the error handler method wil be executed

Compiled: no error on lines 7 and 8, error on line 10 (-20007 Attempting to 
retype by using a pointer)
On line 14, the error handler is not executed, but 4D displays error -20007 
(Attempting to retype by using a pointer)

I would advice to always use the typing parameter (or test using OB is defined)

HTH
Koen



> Op 30 okt. 2017, om 20:20 heeft Tim Nevels via 4D_Tech <[email protected]> 
> het volgende geschreven:
> 
> I did not know that if you include the type in OB GET and the property does 
> not exist in the object you don’t get an error.



--------------------
Compass bvba
Koen Van Hooreweghe
Kloosterstraat 65
9910 Knesselare
Belgium
tel +32 495 511.653

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to