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?
Roster Error
Roster Error
- Attachments
-
- 14861993765681847746140.jpg (538.97 KiB) Viewed 5989 times
Re: Roster Error
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.
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
Please find attached to this post my packed application. Thanks for the help.
- Attachments
-
- Costs and Benefits.zip
- (191.84 KiB) Downloaded 314 times
Re: Roster Error
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;
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
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
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
Thank You. It worked perfectly now.