Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date stamp in Command Window
Message
From
11/01/2008 10:54:06
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01281107
Message ID:
01281163
Views:
9
>>>This probably sounds ridiculous, but every once in a while I scroll up through the history in the Command Window to review something I have done recently. I would be nice (for me anyway) if there was a way to drop a Date stamp into it once a day so I could zero in on what I'm looking for a little easier. I've spent a few minutes trying to do this with no success.
>>>
>>>Short of typing in the date as a comment in the command box each morning, I can't figure out a way to do it.
>>>
>>>If anyone has any ideas on this I'd appreciate it.
>>>
>>>Thanks,
>>>Larry
>>
>>Suppose you have a drive U: with lots of utility programs in the root, add there 2CLIPAST.PRG:
>>
lparameter tcCommentstring
>>
>>private pcCommentstring
>>
>>pcCommentstring = iif( pcount() = 0, '*', tcCommentstring )
>>
>>_CLIPTEXT = ;
>>	pcCommentstring + ;
>>	chr(9) + ;
>>	padl( day( date() ), 2, '0' ) + ;
>>	'/' + ;
>>	lower( left( cmonth( date() ), 3 ) ) + ;
>>	'/' + ;
>>	str( year( date() ), 4 ) + ;
>>	chr(9) + ;
>>	getenv('username') + ;
>>	chr(9) + ;
>>	iif( at( '&', pcCommentstring ) > 0, '-' + chr(9), '' )
>>
>>keyboard "{ctrl+v}"		&& paste CLIP into source
>>
>>return
>>
>>Suppose you have a prg that redefines some keys, add these two lines.
>>
>>
on key label F4       do u:\2clipast with '*'		&& like: 	*	13/jun/2001 pdv -
>>on key label SHIFT+F4 do u:\2clipast with '&'+'&'	&& like: 	&&	13/jun/2001 pdv -
>>
>>In this example the F4 and SHIFT+F4 keys have been redefined and can be used anywhere, so also in the Command Window.
>
>Better to do it without using the _cliptext variable, though. Try to do it directly.
>
>The macro idea is good.

Right you are! I read in the documentation: The keyboard buffer can be filled with up to 128 characters. Once the keyboard buffer is full, additional characters are ignored. In this routine the string never will be more than 128 characters, so it's a good point. The advantage of not using _cliptext is that a previous string in _cliptext is preserved. Thanks, I'll change my 7-year old routine right away.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Reply
Map
View

Click here to load this message in the networking platform