Take notes on the command line: Difference between revisions

→‎{{header|REXX}}: Refurbished and rexx notes ? added
m (→‎{{header|Python}}: Consistent quote style)
(→‎{{header|REXX}}: Refurbished and rexx notes ? added)
Line 2,955:
 
=={{header|REXX}}==
<syntaxhighlight lang="rexx">/*REXX program implements the "NOTES" command (append text to a file from the C.L.). */
nFIDnotes = 'NOTESnotes.TXTtxt' /*the fileID of the "'notes"' file. */
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
if When arg()==0 thenThen Do do while lines(nFID) /*No arguments? Then display the file.*/
Do while lines(notes)>0
Say linein(notes) say linein(Nfid) /*display display a line of file ──►--> screen. */
End
End
Otherwise Do
timestamp=right(date(),11,0) time() date('W') /*create a (current) date & time stamp. */
if If 'f2'x==2 thenThen tab="'05"'x /* this is an EBCDIC system. */
else Else tab="'09"'x /* " " " ASCII " */
Call lineout notes,timestamp call lineout nFID,timestamp /*append the timestamp to "notes" file.*/
Call lineout notes,tab||arg(1) call lineout nFID,tab||arg(1) /* " " text " " " */
End
End /*stick a fork in it, we're all doneDone. */</syntaxhighlight>
{{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. */
end /*while*/
else do
call lineout nFID,timestamp /*append the timestamp to "notes" file.*/
call lineout nFID,tab||arg(1) /* " " text " " " */
end
/*stick a fork in it, we're all done. */</syntaxhighlight>
 
=={{header|Ruby}}==
2,289

edits