<< Click to Display Table of Contents >> Navigation: 3. Script Language > ZIP. - Handle Archives > ZIP-Commands |
MiniRobotLanguage (MRL)
IFZ./NFZ. Conditional Statement
If Exist File/Folder in Zip-Archive
Intention
Conditional Statement. Test if a specified filename or foldername exists inside an Archive or not.
To specify an Folder-Name, suffix it with an "\.
Example:
$$FOL=Target\
You can specify additional Parameters to test if something is a file or a dir.
To search for a file that is inside an Subfolder, you have to specify the whole path of the file as it is inside the Archive.
Example:
§§FIB=Testing\readme2.txt
When you specify the filename / directory path, the robot will check if the last sign of the name/path is a \ (backslash). If the last sign is a backlash, then the command will check for a directory (NOT for a file!). If the last sign is NOT a backslash, the command will check for a file NOT for a directory.
' You can use a wildcard-sign from
' ? - single character
' * - one or more characters
' # - single digit
'
§§FIA=Document.*
§§FIB=?path\Target.zip
IFZ.§§FIA|§§FIB
MBX. File §§FIB xistiert in ZIP-Archiv
ELS.
MBX. File §§FIB xistiert NICHT in ZIP-Archiv
EIF.
You can use NFZ.(Not Exists File in ZIP) as the negative Form of the command.
Syntax
IFZ.P1|P2 … ELS. … EIF.
Parameter Explanation
P1 - Variable/filename/path that should be searched for.
Pathes must be ending with a \ (backslash)
' You can use a wildcard-sign from these
' ? - single character
' * - one or more characters
' # - single digit
P2 - The path to the Archive (ZIP-File) that should be examined.
Example
'**********************************************
' IFZ-Sample
'**********************************************
§§FIA=?path\Target.zip
§§FIB=*readme2.txt
IFZ.§§FIB|§§FIA
MBX. File §§FIB xistiert in ZIP-Archiv
ELS.
MBX. File §§FIB xistiert NICHT in ZIP-Archiv
EIF.
END.
Remarks
IFZ. and other IXX. can be nested to unlimited Depth, and they can also enclose Sub-Program Calls or FEX. (Enumerations) to unlimited Depth.
Limitations:
The use of wildcards should be limited to one wildcard-character.
See also:
• IFZ. / NFZ. - If File in ZIP
• sdk - set default compression
• IEF. / NEF. - If - exist - File