Function

TfrmODBBank.ValidCollTime

Module

fODBBank

Last Modified

7/15/2014 3:26:40 PM

Visibility

Protected

Owner

TfrmODBBank

Declaration

function  ValidCollTime(UserEntry: string): string;

Calls Hierarchy


TfrmODBBank.ValidCollTime
 └StrToFMDateTime

Called-By Hierarchy


                     TfrmODBBank.ValidCollTime
                     TfrmODBBank.SetupDialog┤ 
                 TfrmODBBank.SetOnQuickOrder┤ 
                 TfrmODBBank.cboQuickClick┘ │ 
                  TfrmODBBank.SetupCollTimes┤ 
                  TfrmODBBank.LoadCollType┤ │ 
 TfrmODBBank.DetermineCollectionDefaults┘ │ │ 
        TfrmODBBank.cboAvailTestSelect┘   │ │ 
             TfrmODBBank.SetupDialog┤     │ │ 
        TfrmODBBank.cboAvailTestExit┘     │ │ 
TfrmODBBank.DetermineCollectionDefaults...┤ │ 
             TfrmODBBank.cboCollTypeChange┘ │ 
           TfrmODBBank.cboAvailTestSelect...┤ 
              TfrmODBBank.cboAvailCompSelect┤ 
              TfrmODBBank.cboAvailCompExit┘ │ 
               TfrmODBBank.cboCollTimeChange┤ 
                  TfrmODBBank.btnRemoveClick┤ 
                   TfrmODBBank.SetupDialog┤ │ 
            TfrmODBBank.SetOnQuickOrder...┘ │ 
               TfrmODBBank.calWantTimeChange┤ 
               TfrmODBBank.calCollTimeChange┘ 
             TfrmODBBank.cboCollTypeChange┘   

Calls

Name Declaration Comments
StrToFMDateTime function StrToFMDateTime(const AString: string): TFMDateTime; -

Called-By

Name Declaration Comments
TfrmODBBank.btnRemoveClick procedure btnRemoveClick(Sender: TObject); -
TfrmODBBank.calCollTimeChange procedure calCollTimeChange(Sender: TObject); -
TfrmODBBank.calWantTimeChange procedure calWantTimeChange(Sender: TObject); -
TfrmODBBank.cboAvailCompSelect procedure cboAvailCompSelect(Sender: TObject); -
TfrmODBBank.cboAvailTestSelect procedure cboAvailTestSelect(Sender: TObject); -
TfrmODBBank.cboCollTimeChange procedure cboCollTimeChange(Sender: TObject); -
TfrmODBBank.SetOnQuickOrder procedure SetOnQuickOrder; -
TfrmODBBank.SetupCollTimes procedure SetupCollTimes(CollType: string); -
TfrmODBBank.SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; -


Source

2132  function TfrmODBBank.ValidCollTime(UserEntry: string): string;
2133  var
2134    i: integer;
2135  const
2136    FMDateResponses: array[0..3] of string = ('TODAY','NOW','NOON','MID');
2137  begin
2138    Result := '';
2139    UserEntry := UpperCase(UserEntry);
2140    if StrToFMDateTime(UserEntry) < 0 then exit;
2141    if (UserEntry = 'T') or
2142       (UserEntry = 'N') or
2143       (Copy(UserEntry,1,2)='T+') or
2144       (Copy(UserEntry,1,2)='T@') or
2145       (Copy(UserEntry,1,2)='T-') or
2146       (Copy(UserEntry,1,2)='N+') then Result := UserEntry
2147    else
2148       for i := 0 to 3 do if Pos(FMDateResponses[i],UserEntry)>0 then Result := UserEntry ;
2149    if Result = '' then Result := FloatToStr(StrToFMDateTime(UserEntry));
2150  end;