Take notes on the command line: Difference between revisions
→{{header|REXX}}: Refurbished and rexx notes ? added
m (→{{header|Python}}: Consistent quote style) |
Walterpachl (talk | contribs) (→{{header|REXX}}: Refurbished and rexx notes ? added) |
||
Line 2,955:
=={{header|REXX}}==
<syntaxhighlight lang="rexx">/*REXX program
timestamp=right(date(),11,0) time() date('W') /*create a (current) date & time stamp.*/▼
Select
▲nFID = 'NOTES.TXT' /*the fileID of the "notes" file. */
When arg(1)='?' Then Do
Say "'rexx notes text' appends text to file" notes
Say "'rexx notes' displays file" notes
End
Do while lines(notes)>0
End
End
Otherwise Do
End
{{out}}
<pre>
K:\>rexx notes ?
'rexx notes text' appends text to file notes.txt
'rexx notes' displays file notes.txt
K:\>rexx notes starting work
▲if 'f2'x==2 then tab="05"x /*this is an EBCDIC system. */
▲ else tab="09"x /* " " " ASCII " */
07 Aug 2023 19:39:41 Monday
▲if arg()==0 then do while lines(nFID) /*No arguments? Then display the file.*/
starting work</pre>
▲ say linein(Nfid) /*display a line of file ──► screen. */
▲ call lineout nFID,timestamp /*append the timestamp to "notes" file.*/
▲ call lineout nFID,tab||arg(1) /* " " text " " " */
▲ /*stick a fork in it, we're all done. */</syntaxhighlight>
=={{header|Ruby}}==
|