# Set Variable:New Value: syntax?

**URL:** https://www.finalbuilder.com/forums/t/set-variable-new-value-syntax/4272
**Category:** Discussion
**Created:** [May 10, 2007, 5:39am UTC](https://www.finalbuilder.com/forums/t/set-variable-new-value-syntax/4272 "2007-05-10T05:39:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 10, 2007, 5:39am UTC](https://www.finalbuilder.com/forums/t/set-variable-new-value-syntax/4272/1 "2007-05-10T05:39:44Z")

</div>

Good Afternoon All,

I have just started&nbsp;seeing what Automise can do and I am a bit in the dark as to&nbsp;what

the syntax or what operators can be used in the New Value of a Set Variable action.

It would seem that I may have to exit to a VB script in order to change the value of the variable

used within a For...Loop action. Is this correct?

rgds&nbsp;&nbsp; EdG&nbsp;&nbsp;

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [May 11, 2007, 1:18am UTC](https://www.finalbuilder.com/forums/t/set-variable-new-value-syntax/4272/2 "2007-05-11T01:18:09Z")

</div>

Hi Ed,  
  
You should be able to change the value of the variable using the Set Variable action. What exactly do you want to do?  
  
If you want to do something like  
  
J = J - 1  
  
Then if you look at the “Modifiers” section you’ll see options like “Increment” and “Decrement”, and you can check the “Apply to current value” box.  
  
There are tons of other ways to use this action as well, so if you let us know exactly what you need, we’ll be happy to walk you through it.  
  
Regards,  
  
Angus

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 11, 2007, 1:05am UTC](https://www.finalbuilder.com/forums/t/set-variable-new-value-syntax/4272/3 "2007-05-11T01:05:15Z")

</div>

Angus, Good Afternoon (from this side of the pond), Good Morning , your side.  
Thanks for the quick reply.  
No problem with Increment/Decrement modifier bit but I came unstuck with the following.  
Basically, I defined three variables: Var\_Day, Var\_Month, Var\_Year. Defaulted to 31, 12 and 2007 respectively.  
Then I wanted to decrement Var\_Day by 7; so Set Variable Var\_Day to [NewValue]Var\_Day-7.  
but ‘watching’ the variables gave me the error ‘Var\_Day -7’ is not a valid integer.  
Obviously there is some syntax issue here.  
Also eventually need to Get Date/Time action to put current date into these variables using Options format to extract the relevent parts into Var\_Day, Var\_Month and Var\_Year but suspect that this puts a string value in there. Correct? If so, How do I coerce these to be integers?  
  
Best regards…Ed

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [May 14, 2007, 1:17am UTC](https://www.finalbuilder.com/forums/t/set-variable-new-value-syntax/4272/4 "2007-05-14T01:17:16Z")

</div>

Hi Ed,  
  
You will actually have to use script for these. VBScript/JScript will automatically coerce the string value in the variable to an integer when it sees that you are trying to do arithmetic with the value.  
  
Regards,  
  
Angus

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 14, 2007, 4:01am UTC](https://www.finalbuilder.com/forums/t/set-variable-new-value-syntax/4272/5 "2007-05-14T04:01:30Z")

</div>

Angus,  
  
Thanks for the clarification.  
  
best regards…Ed
