Helper function which is used to generate a new file name based on an existing file name and any number of variable parameter values.

The "Hash Code" is generated as an 8 character Hex sequence and inserted before the file extension.

The same parameters passed in will ALWAYS generate the same Hash Code result value.

Parameters

FileName (string) - The original file name to base the resulting file output name on.

parameter(s) (objects) - One or more parameters or an array of parameters used to generate the hash code result. See examples for possible ways to pass this item. This is known as a "ParamArray" argument type in VB.

Return Value

A modified file name based on parameters passed.

File name in of "File1.asm" could return "File1_E430F5CB.asm"

Remarks

The algorythm used to generate the hash code is a version of the MD5 Hashing Family.

An underscore is always inserted before the hash code in the result.

Changing only the order of the parameter values will also be seen as a new hash code (changed).

Hash Code generation is a case sensitive operation, Parameter of "VaLue" and "value" will generate different hash codes.

Examples

Create with a single simple parameter

Dim fn as string = CAD.FileHashCode("File1.asm", "CONTROLS Pro")
                                              ' will always generate the same hash due to the static value "CONTROLS Pro"

Create a hash code with 2 control values from the questionnaire

Dim fn as string = CAD.FileHashCode("File1.asm", Q("Material Type"), V("Thickness") )
               ' if either value in the thickness control or the Material Type control change the hashcode will be different.