FreedomSoft - "the future is freedom"
Process Before - Validate

The following code is an example of validating data, within Process Before Code. Usually this is only necessary where that data could not be validated using data type, relational integrity, or Freedombase Validation calculations.

Please note that if the Process Before Code sets ErrorMessage, then the Process itself will not write the data to file.

Please note that the Process will still apply all type, relational, and Validation calculations before the data is written to file, and will not write the data if either the Process Before Code set ErrorMessage, or the Process istelf found a data fault. This allows us to mix and match the four methods of validating data (data type, relational, Freedombase validation calculations, and custom code), and enables us to use the most efficient and effective methods for out particular circumstances.

Sample code is:

     SUBROUTINE Freedombase_Cascade_Before(Command,RawData,Instance,Instance_Key,ErrorMessage,Occurrence,DatabaseeClassList,KeyList,InstanceList,ErrorMessageList,SequenceList,NoUpdateFlagList,CurrentSelect,CascadeRecurse,Cascade_Cascade_KeyList,Cascade_CascadeToKeyList,PreviousDatabaseeClassList,PreviousKeyList,PreviousDateTimeWrittenList,PreviousNoUpdateFlagList,User,MetaErrorFlag)

$INCLUDE Process_BP Freedombase_Cascade_Definition
$INCLUDE Process_BP Freedombase_Class_Definition

     IF (Command = 'Save' OR Command = 'Load') AND (Instance) THEN
        CALL Freedombase_Class_SetPointer('Freedombase','Class',Fredombase_Class,MetaErrorFlag)
        IF MetaErrorFlag > 0 THEN
           RETURN
        END
        Class_Key = Instance<Cascade_PointerDatabasee>:Delimiter_Key:Instance<Cascade_PointerClass>
        READ Class_Instance FROM Freedombase_Class,Class_Key ELSE
           Class_Instance = ''
        END
        IF Class_Instance = '' THEN
           ErrorMessage = Class_Key:' is not a valid Cascade System and Cascade Class combination'
           RETURN
        END
     END

     RETURN

  END

previousnext
123456789101112131415161718192021222324252627