stem.pszVariableDescription.1 = "Your name for the source code prolog."
stem.pszVariableValue.1 = "Your name"
stem.pszVariableName.2 = "Date"
stem.pszVariableDescription.2 = "The date for the source code prolog."
stem.pszVariableValue.2 = Date()
stem.pszVariableName.3 = "Application_Type"
stem.pszVariableDescription.3 = "The type of DAX application you want to create: \n1 for C++ \n2 for SOM IDL"
stem.pszVariableValue.3 = "1"
stem.pszVariableName.4 = "File_name"
stem.pszVariableDescription.4 = "The file name for the generated application files, for example, DAXBASIC.\n"
stem.pszVariableValue.4 = "daxbasic"
stem.pszVariableName.5 = "Prolog"
stem.pszVariableDescription.5 = "The prolog that appears at the head of all the generated source files."
stem.pszVariableValue.5 = "/* %FILE_NAME%. This file was created for %YOUR_NAME% by Project Smarts on %DATE%. */"
stem.pszVariableName.6 = "Datastore_Name"
stem.pszVariableDescription.6 = "The name of an existing DB2/2 datastore whose data to access. A connection is established to this datastore in the generated application. "
stem.pszVariableValue.6 = "DATASTOR"
stem.pszVariableName.7 = "DAX_Class"
stem.pszVariableDescription.7 = "Name of the Data Access class to be generated by the Data Access Builder tool."
stem.pszVariableValue.7 = "DAX_Class"
stem.pszVariableName.8 = "DAX_File"
line1 = "File stem of the data access source files to be generated by the Data Access Builder tool. For a C++ application, a 'v' is "
line2 = "appended to this value to form the generated header file name. For a SOM application, an 'i' is appended."
stem.pszVariableDescription.8 = line1||line2;
stem.pszVariableValue.8 = "daxfile"
stem.pszVariableName.9 = "GenType"
stem.pszVariableDescription.9 = ""
stem.pszVariableValue.9 = "Parts"
stem.pszVariableName.10 = "IDLNote"
stem.pszVariableDescription.10 = ""
stem.pszVariableValue.10 = ""
rc = IwfUpdateConsoleProgress(stem);
rc = IwfUpdateConsoleStatus(stem);
SAY "Confirm the settings of variables used to customize the installation."
/* Restore any saved variable settings */
stem.pszCatalog = Cat;
stem.pszApplication = 'VAPSDAX';
rc = IwfRestoreVariables(stem);
if (rc <> RC_OK) then SAY ("Could not restore variable settings. Will use defaults.");
/* Restore date to current date */
stem.pszVariableValue.2 = Date()
/* Display variable settings window */
do until (rc = RC_OK)
rc = IwfQueryVariables(stem);
if (rc = RC_CANCEL) then call Cancel
else
if (rc <> RC_OK) then call Abort("Error querying variable settings.");
call CheckVars;
end
/* Save variable settings */
rc = IwfSaveVariables(stem);
if (rc <> RC_OK) then SAY ("Error saving variable settings.");
/* Process variable settings */
stem.usVariableCount = 10
if stem.pszVariableValue.3 = "1" then stem.pszVariableValue.9 = "Parts"
else stem.pszVariableValue.9 = "IDL"
IDLNote = "\nNote: You also need to generate the .xh files for the Data Access SOM Class \nLibrary, if you have not already done so.\n "
if stem.pszVariableValue.3 = "1" then stem.pszVariableValue.10 = " "
else stem.pszVariableValue.10 = IDLNote
/* Copy the files over, substituting the variable settings. */
stem.usPercent = 50
stem.pszStatusText = "Copying files, with substitution."
rc = IwfUpdateConsoleProgress(stem);
rc = IwfUpdateConsoleStatus(stem);
/* Copy the readme file over */
stem.pszSourceFileMask = Src
rc = IwfCopyWithSubstitution(stem);
if (rc <> RC_OK) then call Abort("Error copying readme file.");
/* Copy source files from the correct directory */
if (DAXType="1") then stem.pszSourceFileMask = Src'\DAXCPP'
else stem.pszSourceFileMask = Src'\DAXSOM';
SAY "The project source files in" stem.pszSourceFileMask "are being copied to" stem.pszTargetDirectory"."
rc = IwfCopyWithSubstitution(stem);
if (rc <> RC_OK) then call Abort("Error performing copy with substitution.");
/* Renaming files */
stem.usPercent = 60
stem.pszStatusText = "Renaming files."
rc = IwfUpdateConsoleProgress(stem);
rc = IwfUpdateConsoleStatus(stem);
curdir = DIRECTORY();
newdir = DIRECTORY(stem.pszTargetDirectory);
SAY "Renaming files in "newdir" to "stem.pszVariableValue.4;
rename 'daxbasic.* 'stem.pszVariableValue.4'.*'
if (rc <> RC_OK) then call Abort("Error renaming files. The specified file name may be invalid or the disk is full. Please delete any created files and start over.");
call DIRECTORY curdir;
/* Create the WorkFrame project */
stem.usPercent = 90;
stem.pszStatusText = "Creating the Workframe/2 project.";
rc = IwfUpdateConsoleProgress(stem);
rc = IwfUpdateConsoleStatus(stem);
SAY "The project will be created in "stem.pszTargetFolder;
/* Get the path of the shell projects */
ShellPath = VALUE('CPPMAIN',,env); /* on CPPMAIN variable path */
if ShellPath='' then call Abort("Error obtaining Project Smarts path.");
ShellPath = ShellPath'\smarts\projects';
if (DAXType="1") then stem.pszSourceProject = ShellPath'\DAXCPP';
if (DAXType="2") then stem.pszSourceProject = ShellPath'\DAXSOM';