User Tools

Site Tools


dcl_lexical_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
dcl_lexical_functions [2018/11/20 19:52] lrickerdcl_lexical_functions [2018/12/03 19:56] lricker
Line 32: Line 32:
 <code> <code>
 $ HELP LEX F$EDIT $ HELP LEX F$EDIT
-   ...displays the help-text for the F$EDIT lexical function+   (...displays the help-text for the F$EDIT lexical function)
 </code> </code>
  
Line 49: Line 49:
   (...displays the complete list of lexical functions...)   (...displays the complete list of lexical functions...)
 </code> </code>
 +
 +The HELP Lexicals entry lists the Lexical Functions alphabetically, which may not be particularly helpful in learning them.  See the wiki article [[Catalog of DCL Lexical Functions]] for a category/functional list of these Lexicals.
  
 ==== Experimenting With and Learning Lexical Functions ==== ==== Experimenting With and Learning Lexical Functions ====
Line 63: Line 65:
 $ $
 </code> </code>
 +
 +Now you can do things like this:
 +<code>
 +$ wso F$TIME()
 +20-NOV-2018 15:33:43.06
 +$
 +</code>
 +
 +...or:
 +<code>
 +$ string = "test"
 +$ wso F$LOCATE( string, "This is a test..." )
 +10
 +$ ! The substring "test" is found at location/position 10 in the larger string.
 +$ ! Position 0 is the first character of that string.
 +</code>
 +
 +<code>
 +$ wso 
 +$ wso F$TRNLNM( "SYS$DISK" )
 +DSA2:
 +$ wso F$DIRECTORY()
 +[LRICKER]
 +$ wso F$SEARCH( "LOGIN*.COM" )
 +DSA2:[LRICKER]LOGIN.COM;10
 +$
 +</code>
 +
 +<code>
 +$ wso F$MODE()
 +INTERACTIVE
 +$
 +</code>
 +
 +<code>
 +$ wso  F$TRNLNM( "SYS$SYSDEVICE", "LNM$SYSTEM_TABLE" )
 +$32$DKA0:
 +$
 +</code>
 +
 +<code>
 +$ fname = "SYS$LOGIN:LOGIN.COM"
 +$ wso F$PARSE( fname, , , "NAME", "SYNTAX_ONLY") + F$PARSE( fname, , , "TYPE", "SYNTAX_ONLY" )
 +LOGIN.COM
 +$
 +</code>
 +
 +<code>
 +$ start = F$TIME()
 +$ ! ...wait a bit...
 +$ !    ...dum-de-dum...
 +$
 +$ wso F$DELTA_TIME( start, F$TIME(), "DCL")
 +0-00:00:21.07
 +$ ! Twenty-one seconds later!...
 +</code>
 +
 +===== See Also... =====
 +
 +For examples of other DCL Lexical Functions in use, see:
 +
 +  * [[Symbol Substitution#String Substitution Examples]] for two uses of ''F$GETDVI''.
 +
 +  * [[Command File Parameters#But My Script Needs More Than 8 Parameters]] for use of ''F$ELEMENT'' and ''F$EDIT''.
 +
  
dcl_lexical_functions.txt · Last modified: 2018/12/03 20:02 by lricker

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki