• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Stamp

New Here ,
Sep 18, 2022 Sep 18, 2022

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;
}

TOPICS
JavaScript

Views

452

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

someone can help me please?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 06, 2022 Oct 06, 2022

Copy link to clipboard

Copied

What is the issue with the code? What happens when you use it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 11, 2022 Oct 11, 2022

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 11, 2022 Oct 11, 2022

Copy link to clipboard

Copied

?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 12, 2022 Oct 12, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 12, 2022 Oct 12, 2022

Copy link to clipboard

Copied

can you please write it in my code?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 13, 2022 Oct 13, 2022

Copy link to clipboard

Copied

LATEST

I could, for a fee. You can send me a message to discuss it in person.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines