Quantcast
Channel: Flexera Community Forums
Viewing all articles
Browse latest Browse all 4553

help with script

$
0
0
Hi, I cannot figure out why this script is not working. It is a very basic file creation based upon a value the user enters. Can someone please see if I am doing something wrong, or if maybe it's a problem with Installshield? The user prompt gets asked, but the newfile.mss does not get created. I am also using Installshield 2009 on windows 7. I have created many similar scripts but this is the first script I've created in IS2009 on windows 7. Many thanks in advance.

NUMBER nvSrYes;
NUMBER nvSrNo;
STRING szSrYes;
STRING szSrNo;
NUMBER nFileHandle;
NUMBER nvFileHandle;
STRING szFileName;
STRING szPath;
STRING szLine;
STRING szLine2;

export prototype SupervisorRelay();

Dlg_SdAskSupvRelay:
ConfSupvRelay:
SetDialogTitle(DLG_ASK_OPTIONS, "ARD supervisor or relay position?");
szMsg = "Is this a relay or supervisor position?";
szSrYes = "Yes";
szSrNo = "No";
nvSrYes = FALSE;
nvSrNo = TRUE;
nValue = EXCLUSIVE;

nResult = AskOptions (nValue, szMsg,
szSrYes, nvSrYes,
szSrNo, nvSrNo);


function SupervisorRelay()
string szFileName[255];
string szPath[255];
string szLine[255];
number nFileHandle;
number nvFileHandle;
begin
OpenFileMode(FILE_MODE_APPEND);

szFileName = "newfile.mss";
szPath = INSTALLDIR;

if ( nvSrYes = TRUE )then
szLine = "REM ARD Relay Supervisor Interface flag: Y = ARD N = Relay/Supv";
szLine2 = "assign $80 'N'";
WriteLine(nFileHandle, szLine);
WriteLine(nFileHandle, szLine2);
endif;

if ( nvSrNo = TRUE )then
szLine = "REM ARD Relay Supervisor Interface flag: Y = ARD N = Relay/Supv";
szLine2 = "assign $80 'Y'";
WriteLine(nFileHandle, szLine);
WriteLine(nFileHandle, szLine2);
endif;

end;

Viewing all articles
Browse latest Browse all 4553

Trending Articles