Quantcast
Channel: Script with two variables - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Script with two variables

$
0
0

I am working on a project that I have to Write a simple script that creates two integer variables (one called Var1 and one called Var2),places the values 2 and 4 in them respectively, and then outputs the value of the two variablesadded together. Its kinda confusing for me since I am still learning writing scripts and batches. This is what I have so far:

    Declare @total@Var1 var1 [= 2][,@Var2 var2 [= 4]]] Set @total = @Var1 + @Var2

To be honest it kinda looks funny.I am just not understand to do this or if I am doing it right. In a way i dont think i should of even put set in there but wasnt understand how to add the two variables together at the end. I do know that a declare script is you can declare one or more variables at a time.So that is why I did the declare for this one.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images