$Sir DateFmt: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:$Sir_DateFmt}} <span class="pageSubtitle"><section begin="desc" />Validate datetime format<section end="desc" /></span> <p class="warning">Most Sirius $functions ...")
 
m (link repair)
 
(38 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Sir_DateFmt}}
{{DISPLAYTITLE:$Sir_DateFmt}}
<span class="pageSubtitle"><section begin="desc" />Validate datetime format<section end="desc" /></span>
<span class="pageSubtitle">Validate datetime format</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="warn"><b>Note: </b>Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Sir_DateFmt function.</p>


The <var>$Sir_DateFmt</var> 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"><span class="term">%tst</span> <span class="literal">= $Sir_DateFmt(</span><span class="term">fmt</span><span class="literal">)</span>
<section end="syntax" /></p>
<p class="caption">$Sir_DateFmt Function
</p>
</p>
where
 
<table class="syntaxTable">
===Syntax terms===
<table>
<tr><th>%tst</th>
<td>Set to 1 if <var class="term">fmt</var> is a valid datetime format string, otherwise set to 0.
</td></tr>
 
<tr><th>fmt</th>
<tr><th>fmt</th>
<td>datetime format string. Refer to for an explanation of valid datetime format strings.</td></tr>
<td>Datetime format string. Refer to [[Datetime string formats]] for an explanation of valid datetime format strings.</td></tr>
<tr><th>%tst</th>
</table>
<td>set to 1 if '''fmt''' is a valid datetime format string, otherwise set to 0.
 
</td></tr></table>
==Usage notes==
<ul>
<li>This $function has no error conditions.
</ul>


==Example==
The following fragment prints the string <code>Good</code>:


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>


 
==Products authorizing {{PAGENAMEE}}==
This $function has no error conditions.
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[List of $functions|Sirius functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|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>


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

Latest revision as of 22:49, 8 February 2018

Validate datetime format

Note: Many $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

%tst = $Sir_DateFmt(fmt)

Syntax terms

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

Usage notes

  • This $function has no error conditions.

Example

The following fragment prints the string Good:

%x = $Sir_DateFmt('CYYDDDHHMISSXXX') If %x = 1 Then Print 'Good' Else Print 'Bad' End If

Products authorizing $Sir_DateFmt