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 Date Separator (ids)

Previous Top Next


MiniRobotLanguage (MRL)

 

DTO.IsDateSeparator Command

Check if a character is a date separator

 

Intention

 

This command determines whether a given character is considered a valid separator character used within date strings.

It checks against a predefined list of common date separators such as '.', '-', '/', '\', space, and others.

The command returns 1 (True) if the character is a date separator, and 0 (False) otherwise.

 

Syntax

 

DTO.isdateseparator|char[|$$RES]

DTO.ids|char[|$$RES]

 

Parameter Explanation

 

P1 - char (Required)

The character (as a string or variable, e.g., $$CHR) to check. Only the first character of the string is evaluated.

 

P2 - $$RES (Optional)

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

 

 

Example

 

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

' DTO.ids - Sample

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

'

DTO.ids|"."|$$RES1

DBV.Is '.' a separator?: $$RES1 ' Result: 1 (True)

'

DTO.ids|"-"|$$RES2

DBV.Is '-' a separator?: $$RES2 ' Result: 1 (True)

'

DTO.ids|" "|$$RES3

DBV.Is space a separator?: $$RES3 ' Result: 1 (True)

'

DTO.ids|"a"|$$RES4

DBV.Is 'a' a separator?: $$RES4 ' Result: 0 (False)

'

' --- Using TOS ---

DTO.ids|"/"

POP.$$TOS

DBV.Is '/' a separator (TOS)?: $$TOS ' Result: 1 (True)

'

ENR.

 

Remarks

 

This command relies on the internal function INT_IsDateSeparator which defines the set of recognized separators.

Commonly recognized separators include: . - / \ : ; _ | ~ space and some others.

The result is a simple boolean (1 or 0) indicating whether the character is in the allowed set.

 

Limitations

 

- Only the first character of the input string (P1) is checked.

 

See also

 

    DTO. - Date Time Operations

    DTO.Is Time Separator - check if char is time separator

    DTO.Get Date Separator - detect date separator char

    DTO.Parse Date - parse date into components