This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Cannot recognize a declared identifier
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 03, 2013
11:36 AM
Cannot recognize a declared identifier
I am trying to write to a log during my installscript execution. I have started with some primitive functionality and the following is tripping me up. Here is the code
//note nvFileHandle has been decalred as a number datatype, earlier
OpenFileMode (FILE_MODE_APPEND);
// Create a new file and leave it open.
CreateFile (nvFileHandle, LOG_DIR, LOG_FILE) ;
szMsg = "This line was appended by an example InstallShield script.";
// Append the message to the file.
if (WriteLine(nvFileHandle, szMsg) < 0) then
// Report the error.
MessageBox ("WriteLine failed.", SEVERE);
endif;
closefile(nvFileHandle);
All of it works until I get to the closefile(nvFileHandle); Then I get the 8025 error and the following message.
Error C8025. InstallShield 2010 » InstallScript Language Reference. 'text' : undefined identifier. Description. The identifier specified by text has not been declared. Notes. All identifiers in a script must be declared...
(I am using Installshield 2012 even though the message mentions 2010)
The troublesome identifier is declared e3arlier in the script (not within a function, so it should be public) The same identifier works twice before the failure. (I traced this by selectively commeting out until finding the offending line)
Can anybody tell me why the identifier is not recognized after 2 successful uses, And/Or how I can make this work?
Thanks,
Melvyn Polatchek
//note nvFileHandle has been decalred as a number datatype, earlier
OpenFileMode (FILE_MODE_APPEND);
// Create a new file and leave it open.
CreateFile (nvFileHandle, LOG_DIR, LOG_FILE) ;
szMsg = "This line was appended by an example InstallShield script.";
// Append the message to the file.
if (WriteLine(nvFileHandle, szMsg) < 0) then
// Report the error.
MessageBox ("WriteLine failed.", SEVERE);
endif;
closefile(nvFileHandle);
All of it works until I get to the closefile(nvFileHandle); Then I get the 8025 error and the following message.
Error C8025. InstallShield 2010 » InstallScript Language Reference. 'text' : undefined identifier. Description. The identifier specified by text has not been declared. Notes. All identifiers in a script must be declared...
(I am using Installshield 2012 even though the message mentions 2010)
The troublesome identifier is declared e3arlier in the script (not within a function, so it should be public) The same identifier works twice before the failure. (I traced this by selectively commeting out until finding the offending line)
Can anybody tell me why the identifier is not recognized after 2 successful uses, And/Or how I can make this work?
Thanks,
Melvyn Polatchek
- Tags:
- installscript
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 03, 2013
01:55 PM
I assume that you are actually calling CloseFile(). Your code is similar to:
http://helpnet.installshield.com/installshield16helplib/mergedProjects/installshield16langref/LangrefCreateFile_Example.htm
except that some of the error checking has been removed. I would check the return code for CreateFile to make sure it has returned a valid handle before using it. I have seen situations where a call to release a resource (such as CloseFile on an invalid handle would be) would confuse the memory manager and cause it to report an error on another variable which is not really related to the problem.
Sorry. Not much to work with, so just a guess.
http://helpnet.installshield.com/installshield16helplib/mergedProjects/installshield16langref/LangrefCreateFile_Example.htm
except that some of the error checking has been removed. I would check the return code for CreateFile to make sure it has returned a valid handle before using it. I have seen situations where a call to release a resource (such as CloseFile on an invalid handle would be) would confuse the memory manager and cause it to report an error on another variable which is not really related to the problem.
Sorry. Not much to work with, so just a guess.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 03, 2013
02:33 PM
Thanks, I will check that out. You are correc that I ued the code you mentioned as my model. As long as we are looking at that: What are the identifiers HWND and hMSI? Do they come from Ifx.h ?
//Snippet from the example
#define EXAMPLE_DIR "C:\\"
#define EXAMPLE_FILE "ISExampl.txt"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype ExFn_CreateFile(HWND);
function ExFn_CreateFile(hMSI)
STRING szTitle, szMsg;
NUMBER nvFileHandle;
begin
// Set the file mode to append.
OpenFileMode (FILE_MODE_APPEND);
//Snippet from the example
#define EXAMPLE_DIR "C:\\"
#define EXAMPLE_FILE "ISExampl.txt"
// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"
export prototype ExFn_CreateFile(HWND);
function ExFn_CreateFile(hMSI)
STRING szTitle, szMsg;
NUMBER nvFileHandle;
begin
// Set the file mode to append.
OpenFileMode (FILE_MODE_APPEND);
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)