jEdit Community - Resources for users of the jEdit Text Editor
Retaining variables between calls to a macro?
Submitted by stretch6555 on Monday, 8 August, 2005 - 12:18
Hi,

I'm writing a macro which, during its execution, creates a few variables. I'd like
to somehow save or retain these variables (and their contents) when the macro ends, so
that they can be referred to the next time I execute the same macro (or indeed some other
macro). Is this possible?

At first, I thought maybe I could declare the variables as 'static', but this doesn't seem
to work. I suppose another way of saving information between calls, might be to put
the data into some of the JEdit clipboard registers. Can someone suggest a good
solution to this problem?

Also, is there some class or method that my macro can call that will tell it what the
last key the user pressed was? And what about the last macro that was executed?

Any help would be most appreciated.


Thanks.
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Properties
by Vampire on Mon, 08/08/2005 - 17:08
I would suggest to use either properties, or temporary properties. Depends on how long you would save it. If you want to keep them after jEdit is closed, then properties, if you only need them whilst one editing session, then temporary properties.

And the other two things, I don't think so, except you save that in another property. Eye-wink
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293