Footrunner Oddity - Count Parameters

Pat Bensky (3/18/14 10:26PM)


Pat Bensky (3/18/14 10:26 PM)

<CANEBDtO-VA4JG9a9ej_-+g0eK37Z=uzpUaA6fOi3e39oMptAzw@mail.gmail.com>

I have a Footrunner script which might be called from two places. If
called
from Place 1, no parameters are passed; if called from Place 2, two
parameters are passed. Here is a code snipet:

C_LONGINT(fr_tableNum)
C_TEXT($1;$2)

fr_tableNum:=0
If (Count parameters>0)
?If ($1#"0") ?// it is running during an import
?=A0?fr_tableNum:=Num($1)
?=A0?fr_fieldnum:=Num($2)
?=A0?fr_fieldptr:=Field(fr_tableNum;fr_fieldnum)
?Else ?=A0// the field was manually modified
?=A0?fr_fieldptr:=Focus object ?// pointer to the last object
?=A0?fr_tableNum:=iTablenumber
?End if
Else
?fr_fieldptr:=Focus object ?// pointer to the last object
?fr_tableNum:=iTablenumber
End if

What happens is that when running as a Footrunner script, it ALWAYS
goes
into the first IF (IF (Count parameters>0). But then we get errors
because
there are NO parameters.

Is it doing this because $1 and $2 have been declared? If so, how do
you
work around this?

Thanks!

Pat

Reply to this message

Summary created 3/19/14 at 6:46AM by Intellex Corporation

Comments welcome at: feedback@intellexcorp.com