Static variables in JS scripts
Static variables in JS scripts
Is it possible to have a static variable that retains its value between script executions?
RJTE version 16.36 (Actual) - 64-bit
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: Static variables in JS scripts
You could save something to disk, maybe using a file stream or a string list...
Re: Static variables in JS scripts
It would be SO NICE if we had a simple variable scheme
in Quick Macros for Power Users so we could use them
for advanced text manipulation.
At least numeric. String would be a plus.
Even if we only got, say, 9 variables. (I'd settle for ONE; or two for dual-processing)
So we could set a variable to a value, and on each
iteration of the macro we could add or subtract a value from it.
And then be able to insert that value into the buffer at the cursor.
Character padding would be nice, left or right.
Like right now I have a text file (PHP file) that has
786 of these array items:
And I want to go down through them and change the two instances of
"000" to a zero left padded number starting from 786 and decrementing to 1.
To have to try to write a script to do it is irritating, especially since the
scripting system isn't particularly easy to use.
So I'll probably end up writing a JS or PHP program to manipulate the text.
At least I know those programming languages, so it is easier to do it that way.
But it would be MUCH easier if we had the simple Quick Macro variable(s).
in Quick Macros for Power Users so we could use them
for advanced text manipulation.
At least numeric. String would be a plus.
Even if we only got, say, 9 variables. (I'd settle for ONE; or two for dual-processing)
So we could set a variable to a value, and on each
iteration of the macro we could add or subtract a value from it.
And then be able to insert that value into the buffer at the cursor.
Character padding would be nice, left or right.
Like right now I have a text file (PHP file) that has
786 of these array items:
Code: Select all
000 => array (
0 => "000",
1 => "/watch?v=ZbQTD7QOanE",
2 => "https://i.ytimg.com/vi/ZbQTD7QOanE/hqdefault.jpg",
3 => "0:49",
4 => "description",
5 => "3 days ago",
6 => "category",
),
"000" to a zero left padded number starting from 786 and decrementing to 1.
To have to try to write a script to do it is irritating, especially since the
scripting system isn't particularly easy to use.
So I'll probably end up writing a JS or PHP program to manipulate the text.
At least I know those programming languages, so it is easier to do it that way.
But it would be MUCH easier if we had the simple Quick Macro variable(s).
RJTE version 16.36 (Actual) - 64-bit
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.
Win 10 Pro 64-bit 8 GB RAM Intel Core i7-6700 3.40 GHz SCSI Hard Drive 1 TB
Note: The signature is dynamic, not static,
so it may not show the correct version above
that was in use at the time of the post.