Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 24 OCT 2002 04:05:26PM a newman wrote:

Is there a way to use a date variable within a macro of captured keystrokes? Have a set of macros which I use to add update comments to my code. For e.g. ALT-1 will playback the captured keystroke:

*021024 - following line modified, A Newman

Would like to be able to replace the "021024" with the current date rather than having to manually modify my macros on a daily basis. Tried adding a DICT VOC item which returns the date in the format I like, but haven't been able to figure out how to add the item to the beginning of my macro string. Tried the "{;K", etc. but can't get it to work. Any ideas?


At 24 OCT 2002 04:41PM Victor Engel wrote:

If it were me, I'd write a program and call it using the S code to run the macro.


At 24 OCT 2002 04:46PM Don Miller - C3 Inc. wrote:

You can have a macro execute a program which returns a Function. Something like:

DECLARE FUNCTION MYDATE(DTE)

D=DATE()

* do whatever fiddling you need .. for example

D1=OCONV(D,"D4/")

Y=FIELD(D1,'/',3)

M=FIELD(D1,'/',2)

D=FIELD(D1,'/',1)

YYMMDD=Y:M:D

RETURN YYMMDD

Catalog / MAKEVOC MYDATE

Then in a Macro, X MYDATE will return the date string

HTH

Don Miller


At 24 OCT 2002 05:44PM a newman wrote:

Hi Don:

Appreciate the response. Tried the suggestion and the function returns the string but won't print out the string in the current document. Need a way to have the string be included in the playback of the captured keystrokes. Any ideas?


At 24 OCT 2002 09:47PM Richard Hunt wrote:

Try this… I think it will get you going in the right direction.

Use the "S:" ( S COLON ) code and the command will be "TEST". Create a subroutine called "TEST". Be sure to catalog the subroutine.

The subroutine should kinda look like this…

SUBROUTINE TEST(ARG1)

@ANS=OCONV(DATE(),'D2/')

RETURN

END

You can change the conversion code to whatever you want.


At 25 OCT 2002 08:05AM Hippo wrote:

I have never done that, but I have read some programs with

CATALYST('K',something).

I suppose, the question was how the formated date can be returned to the keybord buffer … this may be the way.

(I don't know how to change order of keys …)


At 25 OCT 2002 03:21PM a newman wrote:

Thank-you all very much for your suggestions. Your responses are very much appreciated. (Got it working using Richards suggestion of using "S:" and stuffing the string into "@ANS".)

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/59228871a7adddd085256c5c006e5ca8.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1