Jump to content

Documentation: Difference between revisions

Line 936:
There is no provision for attaching documentation to functions, procedures or variables in the code, other than what may be written by the programmer as additional code, and if so, that would be without special support. The source file may contain documentation in the form of in-line comments, permitted wherever a space would appear (outside of text literals) and marked <code>/*...''comment''...*/</code> that may continue across as many lines as desired. There is no "nesting" of comments and an omitted */ might cause trouble. Being typically compiled code, such commentary is long gone when a programme is running, as is the source text. There is no provision for code examination similar to reverse compilation, so there is no way for a routine to identify its caller, or the line in the source file that is being executed. However, a programme might read its own source file and extract information therefrom. With suitable conventions, it could print a copy of its manual and so forth.
 
There are special functions that provide the date and time at the time of compilation during the pre-proccessor stage that might be of use for documentation. DATE || TIME might return something like "870304090130388" and yes, in the 80's it was still a two-digit year number. At compile time, say to determine the timestamp of the compilation as a part of version control and update logging, matters were a little more difficult because the results via the pre-processor were texts and not quoted. Using <code>"DATE"</code> won't work because that is a quoted literal of four letters. Rather than stammering """", confusion could be reduced by <code>TIMESTAMP = QUOTE || DATE || TIME || QUOTE</code> where QUOTE was a pre-processor variable that contained a quote character, stammered once. The pre-processor variable TIMESTAMP would be a text that started and ended with a quote, and could be used in normal source statements as such.
 
=={{header|PowerShell}}==
1,220

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.