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
RETURN
END
END
RETURN
END
| previous | next |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |

