Page 1 of 1

Invalid function call (number of arguments do not agree) using user-defined function

Posted: August 12th, 2018, 11:46 pm
by cristina.jesuitas
Newby and need assistance to this:

Followed functions to simplify looking up geographic names from the examples with a little modification. However, encounter error: Invalid function call (number of arguments do not agree)

function string LookupGeographyName(province, municipal,barangay)

GEOCODE_PROVINCE = province;
GEOCODE_MUNICIPAL = municipal;
GEOCODE_BARANGAY = barangay;
GEOCODE_EA = notappl;

if loadcase(LMIS_GEOCODE_DICT, GEOCODE_PROVINCE, GEOCODE_MUNICIPAL, GEOCODE_BARANGAY, GEOCODE_EA) then
LookupGeographyName = strip(GEOCODE_AREA_NAME);

else
LookupGeographyName = "<Invalid Geocode>";

endif;

end;

red dot point to this line:

function string LookupProvinceName(province)

LookupProvinceName = LookupGeographyName(province, notappl);

end;

Re: Invalid function call (number of arguments do not agree) using user-defined function

Posted: August 13th, 2018, 6:09 am
by josh
The problem is just what the error message says. Your function LookupGeographyName expects three arguments: province, municipal and barangay. However when you call the function you are only supplying two arguments: province and notappl. The number of arguments needs to match.

Re: Invalid function call (number of arguments do not agree) using user-defined function

Posted: August 15th, 2018, 2:29 am
by cristina.jesuitas
thank you josh.