How to increase value in variable by 1

Share your macros, knowledge, solutions, services, ...
Post Reply
Petr
Posts: 106
Joined: Tue Oct 18, 2016 1:12 pm

How to increase value in variable by 1

Post by Petr » Tue Dec 06, 2016 2:46 pm

This example shows how to increase variable value by 1:

Code: Select all

<cmds>
<#>Set initial value to 1
<varset>("v=1","")
<#>Increment the variable by doing + 1
<varset>("v=EXPR(%v%+1)","")
<#>Show expected result v=2
<msg>(-100,-100,"v=%v%","Result",1,0,0,0)

GerritH
Posts: 2
Joined: Tue Jan 09, 2018 9:29 am

Re: How to increase value in variable by 1

Post by GerritH » Tue Jan 09, 2018 9:34 am

Hi Petr,

Thanks, just what I was looking for. I'm new to MTW and are used to working with Quickeys. Could you tell me the way to have the variable read the value from clipboard? I need to have that value increased by 1. I just can't seem to get it right.

Thanks in advance,
Gerrit

GerritH
Posts: 2
Joined: Tue Jan 09, 2018 9:29 am

Re: How to increase value in variable by 1

Post by GerritH » Tue Jan 09, 2018 10:34 am

Oh, got it. Couldn't have done it without your post. Thanks again! :D

Post Reply