Error in search (selcase)

Discussions about CSEntry
Post Reply
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Error in search (selcase)

Post by PHINOJOSA »

Good evening

I need your help, I have created a survey where there is an ingredient finder but when I select the ingredient or food it always returns the same return data, I attach images.

I hope your help in this case that I have, and to obtain the expected result that is to search for the food or ingredient and when selecting the data from the additional table are assigned to the variables of the questionnaire.

I attach the compressed file.

Thank you very much in advance.

Paul Hinojosa
Attachments
01_select.png
01_select.png (41.05 KiB) Viewed 11027 times
02_Load_dat.png
02_Load_dat.png (24.51 KiB) Viewed 11027 times
R24_2.rar
(342.15 KiB) Downloaded 354 times
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Error in search (selcase)

Post by Gregory Martin »

You are allowing the multiple selection of cases:
    CaseFound = selcase(TABLA_DICT, "")
                where pos(strip(BUSCAR), INGREDIENTE) = 1
               
include(INGREDIENTE, ID_GRUPO, ID_AUP)
                multiple; // <--------------
If you do that, you have to iterate over the selected cases to determine what to process: https://www.csprousers.org/help/CSPro/f ... ement.html

However, my guess is that you don't want to select more than one case. If so, remove that "multiple" line and your code will work as expected.
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: Error in search (selcase)

Post by PHINOJOSA »

Thank you very much

With the observation you indicated

Code: Select all

function BUSQUEDA()
	CaseFound = selcase(TABLA_DICT, "")
				where pos(strip(BUSCAR), INGREDIENTE) = 1
				include(INGREDIENTE, ID_GRUPO, ID_AUP);
				ALIMEN = INGREDIENTE;
				CODIGO = ID_CODIGO;
				GRUPO = ID_GRUPO;
				ENERG = ID_ENERG;
				PROTE = ID_PROTE;
				CARBO = ID_CARBO;
				GRTOT = ID_GRTOT;
				GRSAT = ID_GRSAT;
				GTRAN = ID_GTRAN;
				AZTOT = ID_AZTOT;
				AZLIB = ID_AZLIB;
				SODIO = ID_SODIO;
				FUENTE = ID_FUENTE;
				AUP = ID_AUP;
	if not CaseFound then
		errmsg("No se ha seleccionado");
		reenter;
		exit;     {- - - - - - - - - - - - - - - - - - - - - - - > }
	endif;
end;
I could make the modification and now the questionnaire works correctly (I attach images).
Select.PNG
Select.PNG (83.44 KiB) Viewed 11003 times
But I have a problem now that I want to run the questionnaire in Android, the selcase field does not work, the selection option is not displayed, the list that appears in the Windows version does not appear at all.
Deploy.PNG
Deploy.PNG (44.2 KiB) Viewed 11003 times
Android.png
Android.png (108.02 KiB) Viewed 11003 times
Maybe I have not uploaded a file? Or modify the data, could you help me again please.

Thanks
Paul Hinojosa
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Error in search (selcase)

Post by justinlakier »

Hello,

It seems that you're only including your .pen and .pff files in the deployment. If you want the .csdb to be present for lookup purposes, you need to add the csdb file to the deployment, not just sync the dictionary.

Hope that helps,
Justin
PHINOJOSA
Posts: 45
Joined: April 16th, 2023, 10:31 pm

Re: Error in search (selcase)

Post by PHINOJOSA »

Thank you very much

Indeed, when uploading the csdb file it works as expected.

Thank you very much for your help, without you I could not achieve my goals.

Regards
Post Reply