Using White Space

InstallShield 2026 » InstallScript Language Reference

Like C and other programming languages, InstallScript does not recognize white space (spaces and tabs, carriage returns) except in a string literal. It is recommended that you use white space to make your script easier to follow.

Code Without White Space

For example, the following section of code is dense and difficult to decipher:

#define DISK_DRIVE "C:\\"

    STRING szDrive, svString;

    NUMBER nSpace, nResult;

szDrive = DISK_DRIVE;

nSpace = GetDiskSpace(szDrive);

nResult = NumToStr(svString, nSpace);

if (nResult < 0) then

MessageBox("NumToStr failed.", SEVERE);

abort;

endif;

SprintfBox(INFORMATION, "Info", "Disk Space: %s", svString);

Code With White Space

Adding white space with indentation makes the same code much easier to read:

    #define DISK_DRIVE "C:\\"

    

    STRING  szDrive, svString;

    NUMBER  nSpace, nResult;

    

    szDrive = DISK_DRIVE;

    nSpace  = GetDiskSpace(szDrive);

    

    nResult = NumToStr(svString, nSpace);

    if (nResult < 0) then

        MessageBox("NumToStr failed.", SEVERE);

        abort;

    endif;

    

    SprintfBox(INFORMATION, "Info",

              "Disk Space: %s", svString);