0304: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (1 revision)
 
No edit summary
 
Line 2: Line 2:
|0304
|0304
|[[Def]] [[Variable]] type conflict
|[[Def]] [[Variable]] type conflict
|#The number/type/order of [[parameters]] passed in a [[user-defined function]] does not match the number required by the Def [[statement]].
|#The number/type/order of parameters passed in a [[user-defined function]] does not match the number required by the Def [[statement]].
#Inline variable setting within [[user defined function]] calls should be set with <nowiki>:=</nowiki>, not <nowiki>=</nowiki>.  This does not present a problem until the function call is nested within other logic such as an [[if]] statement.
#Inline variable setting within [[user defined function]] calls should be set with <nowiki>:=</nowiki>, not <nowiki>=</nowiki>.  This does not present a problem until the function call is nested within other logic such as an [[if]] statement.
|#Either match the number of parameters to that specified in the Def statement or change the Def statement.
|#Either match the number of parameters to that specified in the Def statement or change the Def statement.

Latest revision as of 21:57, 18 July 2013

Summary:

Def Variable type conflict

Cause:

  1. The number/type/order of parameters passed in a user-defined function does not match the number required by the Def statement.
  2. Inline variable setting within user defined function calls should be set with :=, not =. This does not present a problem until the function call is nested within other logic such as an if statement.

Remedy:

  1. Either match the number of parameters to that specified in the Def statement or change the Def statement.
  2. Change lines like:
if fnX(y=5)=-1 then let z=2

to

if fnX(y:=5)=-1 then let z=2