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

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
cristina.jesuitas
Posts: 6
Joined: July 25th, 2018, 10:56 pm

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

Post 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;
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

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

Post 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.
Post Reply