KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Programming Rules are Enforced More!
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: August 26, 2010

In 4D v11 SQL and 4D v12 there are some programming rules which are enforced more strictly than they were in the past. This can cause unexpected behavior and errors in code where in the past bad code would not have been caught by 4D. Often times, this behavior will only occur when running in Compiled mode.

One good example of this is the New process command. In 4D 2004 and previous versions you could call New process and pass many parameters, even if those parameters were not used in the method being called. For example the following call could be made to New process:

processID:=New Process("myMethod";stackSize;"myProcess";param1;param2;param3)


Even if the method "myMethod" only used param1. For example:

  //myMethod
C_LONGINT($1)

ALERT("You passed "+String($1))


If the same code is run in 4D v11 SQL or 4D v12 in Compiled mode an error will be thrown: "Invalid parameters in an Execute command". This means that the method "myMethod" was called with bad paramters (param2 and param3). Obviously this is not how "myMethod" should be called; so the error is expected. But in previous versions of 4D you could get away with this. Here is a sample screenshot of the error: