! function\validatedateallowzero.brs ! Created on 09/07/2013 ! ! fnValidateDateAllowZero - This Function is for fields with Dates ! where 0 is a valid date. If 0 is detected, normal date processing ! is suspended. If 0 is not detected, normal date processing proceeds ! as usual. Put your Date spec in both the Conversion and UserData ! fields, in order for this to work properly. ! ! def fnValidateDateAllowZero(;___,Number) if trim$(FieldText$)(1:1)="+" or trim$(FieldText$)(1:1)="-" then CnvrtIn$(ControlIndex)=UserData$(ControlIndex) else let Number=99999999 let Number=val(fieldtext$) conv Ignore if Number=0 then CnvrtIn$(ControlIndex)="" else CnvrtIn$(ControlIndex)=UserData$(ControlIndex) end if end if let fnValidateDateAllowZero=1 fnend