vMix Forums
»
General
»
General Discussion
»
How to +=1 a number situated inside other text?
Rank: Member
Groups: Registered
Joined: 1/12/2023(UTC) Posts: 19
Thanks: 5 times
|
Hi guys! I have a text field of a number. I use Text value +=1 or -=1 to increase/decrease it by 1 with a shortkey. It's ok. But I also have a field with other symbols, i.e.: +4' ("plus" "4" and "apostrophe"). I need also to increase/decrease number 4 by 1. Any ideas how to make it? P.S. Searched forum but didn't find it. Thanks! timer forum.png (43kb) downloaded 2 time(s).
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: afonia Hi guys!
I have a text field of a number. I use Text value +=1 or -=1 to increase/decrease it by 1 with a shortkey. It's ok.
But I also have a field with other symbols, i.e.: +4' ("plus" "4" and "apostrophe"). I need also to increase/decrease number 4 by 1. Any ideas how to make it?
P.S. Searched forum but didn't find it. Thanks!
Probably the easiest is to change the value with your shortcut as ususal but to a hidden title text then have a script read that value and send it as a formated text back to your title (call script with same shortcut as the one for the value change) Something like when your title is input 1 and the Headline.Text is the one your shortcut is updating the number Code:Dim number = Input.Find(1).Text("Headline.Text")
dim FullText as string = String.Format("Text is +{0}' ", number)
API.Function("SetText",Input:=1,SelectedName:="Description.Text" ,Value:= FullText)
|
2 users thanked doggy for this useful post.
|
|
|
Rank: Member
Groups: Registered
Joined: 1/12/2023(UTC) Posts: 19
Thanks: 5 times
|
It works!!!
Thank you!
Can you modify this code to be able make both +1 and -1, please. Thank you again!
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/24/2021(UTC) Posts: 542 Location: athens Thanks: 130 times Was thanked: 74 time(s) in 70 post(s)
|
Originally Posted by: afonia It works!!!
Thank you!
Can you modify this code to be able make both +1 and -1, please. Thank you again! I tried it and notice that the code work both. If it goes up or down it depends on how you setup the shortcut in vmix. So if we do a shortcut +=1 will go up and another shortcut -=1 it will go down.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: afonia It works!!! of course it does ur welome Quote: Can you modify this code to be able make both +1 and -1, please. Thank you again!
@nikosman88, I believe he means the sign displayed easy (simplest way), duplicate the script and replace the + with a - and call that script when you do a -=1 Could do some testing within the script for that too but then again would have to change it again when another wish is made ;-)
|
|
|
|
Rank: Member
Groups: Registered
Joined: 1/12/2023(UTC) Posts: 19
Thanks: 5 times
|
Quote:I tried it and notice that the code work both. If it goes up or down it depends on how you setup the shortcut in vmix. So if we do a shortcut +=1 will go up and another shortcut -=1 it will go down. Hm, it works only for +1 shorcut. When I press -1 shortcut my Injury mins.Text field looks like this: =-1 Quote: I believe he means the sign displayed No. Text (+ ') remains the same. Only number should change +1 or -1 every time I press corresponding shorcut. It's for football injury time adjusting. Here is my script. Code:Dim number = Input.Find(2).Text("Description.Text")
dim FullText as string = String.Format("+{0}'", number)
API.Function("SetText",Input:=2,SelectedName:="Injury mins.Text" ,Value:=FullText)
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: afonia Hm, it works only for +1 shorcut. When I press -1 shortcut my Injury mins.Text field looks like this: =-1
check the shortcut: value should be -=1
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
How to +=1 a number situated inside other text?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close