3/94

    INSDATE.DLL - insert date/time in user-specified format

    This DLL provides an API call that inserts a text string
    containing the date and/or time at the current cursor position.
    It is similar to TMSTAMP, but accepts a template string
    as an argument to specify the format of the output string.

    Syntax:

	void BufInsertDate(LPSTR template)

	where template is a string of characters which may contain
	any punctuation in addition to the following characters:

		WNDHMSCYT
	 Wed Mar 17 14:27:52 1999
	If no template string is given, the following is used:

		"W N D H:M:S CY"

	This produces an output string like:

		Tue Mar 22 11:21:33 1994

	Here is how the characters are expanded:

		W	- Day of week, in a three-letter abbreviation
		N	- Month, in a three-letter abbreviation
		T	- Month, as a number (not zero-padded)
		D	- Day of month, as a number
		H	- Hour of day (24-hour)
		M	- Minute
		S	- Second
		C	- Century (19)
		Y	- Year (94)


    To use this package, copy INSDATE.DLL into the CWRIGHT directory.
    Load the DLL through Codewright's Tools|Libraries dialog by
	clicking on Add and browsing for the appropriate DLL.
	The preceding process adds this line to the [Editor] section of 
	CWRIGHT.INI:

        LibPreload=INSDATE

	That's all there is to it.


04-May-1994 - DPM
Modification to INSDATE.C by Dan McCann

I tried to use INSDATE and found it useful.  I decided it would be
a great way to start off a comment line ensuring timestamping.
Not all programmers timestamp their work (Who?  Me?!?) adequately.

What to my surprise, INSDATE would not take \n as newline!  If you
tried to use any of the 'special' characters, the results were
disasterous.  In its original form, I tried the call
	BufInsertDate("D-N-CY - DPM\n")
and got
	04-May-1994 - 04P42
This put a quick stop to my plans.  A fix was needed and fast if
this was to work for me.  I inserted a check for escaped characters
in the format.  Any escaped characters are handled to allow the use
as follows
	BufInsertDate("D-N-CY - \DP\M\n")
to produce
	04-May-1994 - DPM
It may be a little awkward, but it follows conventions.
As once was compiled in 1991 and reproduced in PC TECHNIQUES
titled "Shooting Yourself in the Foot":

"... The proliferation of modern programming languages (all of which seem
to have stolen countless features from one another) sometimes makes it
difficult to remember what language you're currently using.  This guide
is offered as a public service to help programmers who find themselves
in such dilemmas.

"C: You shoot yourself in the foot.

"C++: You accidently create a dozen instances of yourself and shoot them
in the foot.  Providing emergency medical assistance is impossible since
you can't tell which are bitwise copies and which are just pointing at
others and saying, 'That's me, over there.'

"Unix: % Is foot.c foot.h foot.o toe.c toe.o % rm *.o rm:.o:No such file
or directory % Is %

Enough already, I hope you find my enhancements useful.
