Date & Time Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Date and Time Calculation > DTO. - Date Time Operations >

Date & Time Operations

DTO.Is Time Separator (its)

Previous Top Next


MiniRobotLanguage (MRL)

 

DTO.Is Time Separator - Command

Check if a character is a time separator

 

Intention

 

This command determines whether a given single character is recognized as a valid separator character used within time strings.

It returns 1 (true) if the character is a time separator and 0 (false) otherwise.

This is useful for validating characters or finding separators within time-related strings.

 

Syntax

 

DTO.is time separator|char[|$$RES]

DTO.its|char[|$$RES]

 

Parameter Explanation

 

P1 - char (Required)

The single character (or a variable containing a single character, e.g., $$CHR) to check.

 

P2 - $$RES (Optional)

The variable (e.g., $$RES) where the result (1 or 0) will be stored. If omitted, the result is placed on TOS.

 

 

Example

 

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

' DTO.its - Sample

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

'

' --- Check common separators ---

DTO.its|:|$$RES1

DBV.Colon: $$RES1 ' Result: 1 (True)

DTO.its|.|$$RES2

DBV.Period: $$RES2 ' Result: 1 (True)

DTO.its|-|$$RES3

DBV.Hyphen: $$RES3 ' Result: 1 (True)

'

' --- Check a non-separator ---

DTO.its|A|$$RES4

DBV.Letter A: $$RES4 ' Result: 0 (False)

'

' --- Check using a variable ---

$$CHR = ","

DTO.its|$$CHR|$$RES5

DBV.Comma: $$RES5 ' Result: 1 (True)

'

ENR.

 

Remarks

 

The command checks against a predefined list of characters considered valid time separators.

Recognized time separators (and their ASCII codes):

, - . / : ; \ _ | ~ •   ¦ ·

(ASCII: 44, 45, 46, 47, 58, 59, 92, 95, 124, 126, 149, 160, 166, 183)

The result is always a numeric value (1 or 0).

 

Limitations

 

- Only the first character of the input string (P1) is checked. If P1 contains multiple characters, the result is based solely on the first one.

- An empty input string for P1 will result in an error.

 

See also

 

    DTO. - Date Time Operations

    DTO.Get Time Separator - detect time separator char

    DTO.Is Date Separator - check if char is date separator

    DTO.Count Time Separators - count separators in time