Display a variable through another variable script box

Hi,
is there a way to display a variable through another variable script box?
I tried var(2) = "\v[1]" but it returns [1].
var(1) is a numeric value.
I have a plugin which can check strings stored in a variable, but it seems unable to check directly var(1), probably because it is a numeric value and not a string.
So I thought to make variable (1) value a string in order to make the plugin check it and I thought this could be a method....
Don't know what you intend to do...
I assume what you mean by "displaying" is showing it on message box?

It's not the variable fault. Even if the value is a number, the variable will adapt (if it's not restricted) so that won't be a problem.

To directly translate an escape code (only work inside window base), replace "\" with "\x1b".
ex :
1595166506729.png


Non-window related, use $gameVariables.value(ID)

Reference:
Don't know what you intend to do...
I assume what you mean by "displaying" is showing it on message box?

It's not the variable fault. Even if the value is a number, the variable will adapt (if it's not restricted) so that won't be a problem.

To directly translate an escape code (only work inside window base), replace "\" with "\x1b".
ex :
View attachment 151833

Non-window related, use $gameVariables.value(ID)

Reference:
Yeah, well your tips works but it seems it doesn't do what I need....
I hoped to not have to write this whole thing, but...
I have a free input text plugin which can store a string (written by the player) in a variable.
I needed to check dates stored in that variable, but I can't find a way to make javascript check for the dd/mm/yyyy format (it checks only yyyy/mm/dd or mm/dd/yyyy).
So I tried to do a checking date system manually as follow:

Check if the variable(x) which contains the string contains a number ("01" in this case):
Code:
(function(){ words = ["01"]; for(i=0;i<words.length;i++){if(!RegExp("\\b"+words[i]+"\\b").test($gameVariables.value(x).toLowerCase())){break}};if(words.length===i)return!0})()

If yes search for a 4 digit number (year) in that string and store it in another variable (w):
Code:
var year = parseInt($gameVariables.value(x).match(/\d{4}/)[0]);
$gameVariables.setValue(w, (year>=1000 && year <= 9999) ? year : 0);

Count occurences for "01" in the whole string and store that number in another variable (y):
Code:
$gameVariables.setValue(y, ($gameVariables.value(x).match(/01/g) || []).length)

Then I needed to count occurences of that "01" only in var(w) (the year number) and store it in another var(z):
Code:
$gameVariables.setValue(z, ($gameVariables.value(w).match(/01/g) || []).length)

In order to subtract them from the total recurrences number:
var(y) - var(z) = number of "01" occurrences in day and month

Then, checking some other few things, I can tell if that "01" is a day or a month.....
My problem is that I can't get that var(z), it returns always 0 even if the year is "2001"...
I thought the problem was what I wrote in the first post.
This is the whole story.
I think you're working yourself along the wrong way, resulting in a needlessly complex structure.
You should handle this differently.
Unfortunately I can't give you the code, only describe the pronciples. You'll have to work out the exact code yourself.

1) look for the deviders between the numbers and split the main text into three along them.
2) transform the three textnumbers into real numbers (there are commands for this as soon as the dividers are gone and the numbers seperated
3) check how high the numbers are to determine which one is the year number
4) based on which one is the year number, assign the other two to days or months
5) work on whatever you want to do with the date from then on
Also, once you've figured out which part is the year, month, and day, you can make a date object like this:

JavaScript:
var date = new Date(year, month, day);

This might make some things easier if you need to compare or manipulate the date.
Solved

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/display-a-variable-through-another-variable-script-box.124235/