Copy link to clipboard
Copied
Hello,
I have a custom stamp that increase a number or letter like: 1,2,3 or A, B, C
I want to upgrade the code of the stamp for increase like this: A1, A2, A3 or B1, B2, B3
how can i do this?
this is the code:
if( event.source.forReal && event.source.stampName == "#qT1ZWzIPGprVS_jnLHz-tB") {
if ("aincState" in event.source.source.info) {
if (!isNaN(event.source.source.info.aincState)) {
event.source.source.info.aincState = String(Number(event.source.source.info.aincState)+1);
} else if (event.source.source.info.aincState.length == 1) {
var ascii = event.source.source.info.aincState.charCodeAt(0);
if ((ascii >= 65 && ascii < 90) || (ascii >= 97 && ascii < 122)) {
event.source.source.info.aincState = String.fromCharCode(ascii+1)
} else if (ascii == 122) {
event.source.source.info.aincState = "a";
} else
event.source.source.info.aincState = "A";
} else {
event.source.source.info.aincState = "A";
}
} else {
event.source.source.info.aincState = app.response("Enter number or letter:", "Initialize State");
}
event.value = event.source.source.info.aincState;
}
Copy link to clipboard
Copied
someone can help me please?
Copy link to clipboard
Copied
What is the issue with the code? What happens when you use it?
Copy link to clipboard
Copied
The code is working, but i want to upgrade it with no sucsess.
im trying to do an option if i wrote A1 its will be next A2, A3 ..
if i wrote B1 its will be next B2, B3 .. you understand me?
Copy link to clipboard
Copied
?
Copy link to clipboard
Copied
Save the value you enter into the global variable, and when you want to increment it strip all the non-digits from it, increment by one and then replace the old number with the new name.
Copy link to clipboard
Copied
can you please write it in my code?
Copy link to clipboard
Copied
?
Copy link to clipboard
Copied
I could, for a fee. You can send me a message to discuss it in person.