On Oct 31, 2017, at 2:00 PM, Koen Van Hooreweghe wrote:

> 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)

Hi Koen,

Good info on this topic. I do use "OB Is defined” a lot to avoid the compiler 
errors. Actually I use a wrapper method that does this for me. 

It does show what 4D Engineering is getting sloppy in how they developed and 
implemented objects in 4D. They are supposed to make interpreted code produce 
the same kind of error messages that occur in compiled code. This is an example 
of that not being done. Obviously the guys doing the compiler work don’t talk 
to the guys that are doing the interpreter work. A pity. It makes for a product 
that is not “polished”. 

Reminds me of how for so long CLEAR VARIABLE acted different in interpreted 
mode compared to compiled mode. They fixed that issue. Hope they do the same 
for object. 

Tim

********************************************
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
********************************************

**********************************************************************
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:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to