Page 1 of 1
Roster Error
Posted: February 4th, 2017, 4:13 am
by Learner
I tried to create the logic that would help me end the roster. But I seem to get this error message (Error: You must assign the result of the function to an alpha near line 1 in APPLIANCES procedure).
Please can anyone help me?
Re: Roster Error
Posted: February 4th, 2017, 12:47 pm
by josh
My guess is that APPLIANCES is a numeric variable from your dictionary. You cannot compare a number to a string. "" is of type string. To check if a numeric variable is blank compare it to notappl:
if APPLIANCES = notappl then
...
If that isn't the problem please attach your application. Use the pack application tool to create zip file and send it to us. It is easier for us to figure out the problem if we have the application instead of just a screenshot.
Re: Roster Error
Posted: February 7th, 2017, 6:11 am
by Learner
Please find attached to this post my packed application. Thanks for the help.
Re: Roster Error
Posted: February 7th, 2017, 2:43 pm
by josh
Looking at your app I can confirm that APPLIANCES is a numeric variable as I guessed. Change your logic to compare it to notappl instead of to "" and it will compile without error:
PROC APPLIANCES
If APPLIANCES = notappl then
numeric finished;
finished = accept("Are you done capturing all the appliances in the household?", "Yes", "No");
if finished = 1 then
endgroup;
else
reenter;
endif;
endif;
Re: Roster Error
Posted: February 9th, 2017, 4:30 am
by Learner
Thank you very much. The compile was successful but I still don't get the accept options if I choose no option in the appliances field. Please can anything be done about that?
Re: Roster Error
Posted: February 9th, 2017, 7:24 am
by josh
Since your value set for APPLIANCES does not include notappl when you try to enter blank you are getting an out of range error. You can add notappl to the value set in the dictionary and then the range check will pass and you will see the accept.
Re: Roster Error
Posted: February 15th, 2017, 5:04 am
by Learner