If Compare Action

Description

Compares two files and fails the step if the files are different. "If" is an extremely useful action. It allows decisions to be made during the execution of the Workflow depending on the result of an expression evaluation. Some examples of simple (although impractical) expressions are: as 1=1 (true). Or 1>2 (false).

Of course the kinds of expressions more likely to be used in the "If" action are: city = "Los Angeles" or count = 100. If the result evaluates to TRUE, Automated Workflow will execute the block of steps immediately following the If action up until an End If is encountered, otherwise the block will be skipped (or if an Else <AMELSE> statement is encountered it will execute that block of steps). All If actions must be followed at some point with an End If <AMENDIF> to mark the end of the code block that is to be executed if the expression is true.

Declaration

<AMIF TYPE="COMPAREFILES" FILEA="FilenameA" FILEB="FilenameB" COMPARETYPE="" HASHTYPE="CRC" />

Example

<AMIF TYPE="COMPAREFILES" FILEA="C:\Documents and Settings\marie.black\My Documents\dungeon.txt" FILEB="C:\Documents and Settings\marie.black\My Documents\bpaserver.txt" COMPARETYPE="CRC" HASHTYPE="CRC" />

General Tab Parameters

File A: Specifies one file to compare with another.

Text, Required
MARKUP:

File B: Specifies a second file to compare against File A.

Text, Required
MARKUP:

Compare Type: Specifies the criteria to use when comparing the two files.

The available options are:

  • Size

  • CRC/Hash

  • Creation Date

  • Modified Date

  • Last Accessed Date

  • Attributes

Algorithm: If you select the CRC/Hash Compare Type, the Algorithm box becomes available. The available options are:

  • CRC

  • MD5

  • SHA1

  • SHA256

  • SHA356

  • SHA512

See Also

Loop, The BASIC Language All Groups, Else, End If