IBT. / NBT. - If Before Timestamp

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Date and Time Calculation >

IBT. / NBT. - If Before Timestamp

IBT. / NBT. - If Before Timestamp

Previous Top Next


MiniRobotLanguage (MRL)

 

IBT. / NBT. Conditional Statement

If Before Timestamp / If NOT Before Timestamp

 

 

Intention

 

What is a TimestamP

A Timestamp is a Time-Value in the Format: HH:MM:SS or HH:MM:SS.mmm

 

Using the TCA. and these other Time-Stamp Commands you can work with Timestamps.

 
IBT. will need two timestamps as Parameter. It will then compare both Timestamps and decide

if Timestamp P1 is BEFORE Timestamp P2.

If Timestamp P1 is equal to Timestamp P2 then the time P1 is NOT BEFORE P2.

If you specify an @ Sign in front of P1 then the statement will evaluate if P1 = P2 means If Timestamp 1  is equal to Timestamp 2 instead.

 

In case of an error, the IBT. will by default evaluate to true, but will raise an error on TOS.

 

Hint: $time$ will return a timestamp like: 12:01:40

If one or both Parameters include  ".000"  Microseconds, then these will also be evaluated.

If Microseconds are missing, they will be ignored.

 

The negative Form of this statement is NBT.

 

clip0414

 

clip0415

 

 

clip0416

clip0417

 

Now here is the special Mode using the @ Operator.

 

clip0418

clip0419

 

 

 

And finally.

 

clip0420

 

clip0421

 

 

 

Syntax

 

 

IBT.[@]P1|P2 ... ELS. ... EIF.

NBT.[@]P1|P2 ... ELS. ... EIF.

 

 

Parameter Explanation

 

P1 - Timestamp 1 that needs to be AFTER P2 for this to evaluate to TRUE.

       If you specify an @ Sign in front of P1 then the statement will evaluate if P1 = P2 means If Timestamp 1  is equal to Timestamp 2 instead.

 

P2 - Timestamp 2

 

 

 

Example

 

'**********************************************

' IAT. - Sample Macros

'**********************************************

':Insert_TPS

$$EIN=00:00:01

$$ZWO=00:00:03

VAN.$$CNT=0

TCA.Add|$$TIA|$$EIN|$$STA

TCA.Dif|$$TIB|$$ZWO|$$ENA

%FOT $$STA|$$ENA|$$EIN

VIC.$$CNT

$$TIM=$$LOP

%NXT

RET.

 

'-----------------------------------------------------------

' These two Macros define a Timestamp-FOR Loop

' So you can Loop from P1 to P2 using Step P3

'

: %FOT 3

$$FOA=§§§01

$$FOB=§§§02

$$FOC=§§§03

$$LOP=$$FOA

DOL.  

'EIF-

END%  

'-----------------------------------------------------------

'

'-----------------------------------------------------------

'

: %NXT

TCA.Add|$$LOP|$$FOC|$$LOP

BCH.$$LOP|.|1|$$TOP

BCH.$$FOB|.|1|$$BOP

IAT.$$TOP|$$BOP

$$LOV=1

ELS.

$$LOV=0

EIF.

PRT.$$TOP / $$BOP  ($$LOV)

OOP.$$LOV

'EIF+

END%  

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also:

 

    GFD. - Get File Date

    GFV. - Get File Version

    IFD. / NFD. - If File Date

    IFV. / NFV. If File Version

    GSS. - GetSplitString