Complile error

Other discussions about CSPro
Post Reply
kabalaandrew
Posts: 1
Joined: March 29th, 2024, 11:47 am

Complile error

Post by kabalaandrew »

Hello CSPro users,
I am trying to create a login app, and one of the functions is to create the app version via code. When I compile the application, I get the following error. ERROR(APP_VERSION, 22): 'FindResult' is not a declared variable or is a misspelled dictionary entry

This is my function below:

Code: Select all

PROC APP_VERSION

preproc 
{**** APPLICATION VERSION ****}
	FindResult = fileexist("..\103_Ext_Data\Version.txt");
	FindResult = fileexist("..\103_Ext_Data\Version.txt");
	if FindResult = 1 then
		setfile(AppVersion, "..\103_Ext_Data\Version.txt");
		
		{*** If more than one version, get latest version ***}
		
		while fileread(AppVersion, PreLoad_Data) do;
					$ = tonumber(PreLoad_Data[1:4]);
		enddo;
		
		{**** End ****}
		
		close (AppVesrion);
		
	else
	
		$ = 0.01;
		setfile(AppVersion, "..\103_Ext_Data\Version.txt", create);
		PreLoad_Data = concat("0.01 STARTING DATE IS ", edit("99-99-9999",sysdate("DDMMYYYY")))
		filewrite(AppVersion, "%s", PreLoad_Data);
		close(AppVersion);
		
	endif;
How can I resolve this error?

Regards,
Andrew
justinlakier
Posts: 155
Joined: November 21st, 2022, 4:41 pm

Re: Complile error

Post by justinlakier »

Hi,

FindResult needs to be declared as a numeric variable before being assigned. You can declare it as a Numeric variable earlier in this Proc or in Proc Global, initialize it with a value if you want, and then refer to it here to assign it the value from FindResult .

Hope this helps,
Justin
Post Reply