$Sir DateFmt: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 2: Line 2:
<span class="pageSubtitle"><section begin="desc" />Validate datetime format<section end="desc" /></span>
<span class="pageSubtitle"><section begin="desc" />Validate datetime format<section end="desc" /></span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Sir_DateFmt function is [[to be entered]].</p>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Sir_DateFmt function.</p>


The $Sir_DateFmt function expects a datetime format string and returns the value 1 if the datetime format is valid, else the value 0.


The $Sir_DateFmt function expects a datetime format string and returns the value 1 if the datetime format is valid, else the value 0.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %tst = $Sir_DateFmt(fmt)
<p class="syntax"><section begin="syntax" /> %tst = $Sir_DateFmt(fmt)
Line 12: Line 11:
<p class="caption">$Sir_DateFmt Function
<p class="caption">$Sir_DateFmt Function
</p>
</p>
where
where
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>fmt</th>
<tr><th>fmt</th>
Line 18: Line 19:
<tr><th>%tst</th>
<tr><th>%tst</th>
<td>set to 1 if '''fmt''' is a valid datetime format string, otherwise set to 0.
<td>set to 1 if '''fmt''' is a valid datetime format string, otherwise set to 0.
</td></tr></table>
</td></tr>
</table>


For example, the following fragment prints the string <tt>Good</tt>:


For example, the following fragment prints the string <tt>Good</tt>:
<p class="code"> %X = $Sir_DateFmt('CYYDDDHHMISSXXX')
<p class="code"> %X = $Sir_DateFmt('CYYDDDHHMISSXXX')
  IF %X = 1 THEN
  IF %X = 1 THEN
PRINT 'Good'
    PRINT 'Good'
  ELSE
  ELSE
PRINT 'Bad'
    PRINT 'Bad'
  END IF
  END IF
</p>
</p>


This $function has no error conditions.


This $function has no error conditions.
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[Sirius functions]]</li>
Line 41: Line 43:
<li>[[Japanese functions]]</li>
<li>[[Japanese functions]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
 
<li>[[Sir2000 User Language Tools]]</li>
<li>''[[Sir2000 User Language Tools]]''
</ul>
</ul>
<p class="caption">Products authorizing $Sir_DateFmt
<p class="caption">Products authorizing $Sir_DateFmt
</p>
</p>


[[Category:$Functions|$Sir_DateFmt]]
[[Category:$Functions|$Sir_DateFmt]]

Revision as of 19:12, 8 February 2011

<section begin="desc" />Validate datetime format<section end="desc" />

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Sir_DateFmt function.

The $Sir_DateFmt function expects a datetime format string and returns the value 1 if the datetime format is valid, else the value 0.

Syntax

<section begin="syntax" /> %tst = $Sir_DateFmt(fmt) <section end="syntax" />

$Sir_DateFmt Function

where

fmt datetime format string. Refer to for an explanation of valid datetime format strings.
%tst set to 1 if fmt is a valid datetime format string, otherwise set to 0.

For example, the following fragment prints the string Good:

%X = $Sir_DateFmt('CYYDDDHHMISSXXX') IF %X = 1 THEN PRINT 'Good' ELSE PRINT 'Bad' END IF

This $function has no error conditions.

Products authorizing $Sir_DateFmt