Effectively it allows you to replace the "TESTPCN001" in CREATE( "TESTPCN001" , 199) with a new unique reference from the v-test_Case_Ref variable.
Code: Select all
#==
#===== Create Unique Test File Reference
#==
#=== Create Prefix String
v-test_Case_Type = "TEST"
v-test_File_Type = "PCN"
#=== Loop While Case Ref Exists
WHILE v-test_Case_Status <> "does not exist" DO
#=== Set First Test Ref To End 001
IF v-test_File_Number = 0 THEN
v-test_File_Number = 001
ELSE
#=== Add Leading Zeros As Maths Removes them
v-test_File_Number = v-test_File_Number + 01
v-len = LENGTH( v-test_File_Number v-test_File_Number )
IF v-len = 1 AND v-test_File_Number = 2 THEN
v-test_File_Type = v-test_File_Type + "00"
ELSEIF v-len = 2 AND v-test_File_Number = 10 THEN
v-test_File_Type = v-test_File_Type + "0"
END
END
#=== Combine Strings And Numbers To Create Test Case Ref
v-test_Case_Ref = v-test_Case_Type + v-test_File_Type + v-test_File_Number
#MESSAGE( NEWLINE , "Test Case Ref: " , v-test_Case_Ref )
#=== If Case Ref Exists Loop Until It Doesn't
STATUS( v-test_Case_Ref )
v-test_Case_Status = return-value
END
#==
#===== Final Test Case Ref
#==
MESSAGE( NEWLINE , v-test_Case_Ref )
#==
#===== Create Unique Test File Reference
#==

John