Estimize

adding 2 variables into 1 variable

9 posts in this topic

#1 ·  Posted (edited)

Can anyone help me add two variables together, I am relatively new to autoit so I am sorry in advance for a lack of information.

$Call1+$Click1 = $EndValue1

I do this and I get an error message saying that a "=" is expected instead.

Edited by Estimize
misspell

Share this post


Link to post
Share on other sites



Share this post


Link to post
Share on other sites

Just know that in programming, when you want to set a value to something it is 

Hello = X + X

The "=" can be refered to EQUAL TO most of the time.

Share this post


Link to post
Share on other sites

The "=" can be refered to EQUAL TO most of the time.

The "=" can be refered to ASSIGN TO most of the time.
Refered to 'equal to' when used as a comparison operator (test in a condition)
:)
 

Share this post


Link to post
Share on other sites

yep true, in a condiction its equal.

other than that assign to, thumbs up mikell :)

Share this post


Link to post
Share on other sites

I think it depends on the type of variables. For integers as others have already suggested:

$EndValue1 = $Investment1+$Profit1

But for string variables you should use the following:

$EndValue1 = $Investment1 & $Profit1

Share this post


Link to post
Share on other sites

Factfinder, your second example isn't adding the two together, it's concatenating them into one longer string. Not the same thing.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites


BrewManNH, you are right about the semantic precision. I wasn't sure about the type of variables the OP is talking abut and if "adding" was used instead of concatenating two string variables. I think in C++ both adding (like in case of integer variables) and concatenating is done the same way:

$totalvar=$var1+$va2

I just wanted to mention the difference in Autoit.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • Valnurat
      By Valnurat
      I hope my title is good enough.
      I'm using the ADO UDF and I have question regarding editing SQL records with this UDF.
      The owner of the UDF suggested an idea, but maybe there is another trix.
    • Valnurat
      By Valnurat
      I have a SQL db. I would like to view the content in a control. Like a table. The control should have the option to show every 2nd line in another color. When you pick a "cell" it should pick the whole row. When you dobbelt click on the row another windows should popup with the content from the row.
      What view control can do that?
    • Valnurat
      By Valnurat
      How do I access a sql database for inserting and reading?
    • Valnurat
      By Valnurat
      I'm trying to get some info from dell.com page. I use a servicetag to find the computer. From the computerinfo I would like to get the "Shipping Date", but the date is on the next "cell".
      I have done this and I don't know if this is correct aproach, but I do get some info out.
      I just don't know how to "jump" to the next cell.
       
      #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate("http://www.dell.com/support/home/dk/da/dkbsdt1/product-support/servicetag/gnn5f12/configuration") Local $oTds = _IETagNameGetCollection($oIE, "td") Local $sTxt = "" For $oTd In $oTds $sTxt &= $oTd.innertext & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Form Input Type", " Types :" & @CRLF & $sTxt) _IEQuit($oIE) I have seen something like this in VBscript
      Cell.NextSibling.NextSibling.innertext Is there someone who could help me.
       
    • srini
      By srini
      I am trying to automate the windows GUI application, in the main window of this application i have one gridview control in it, and when you click on the any row of the gridview separate windows will be opened based on the selection of the row. 
      we have our existing framework implemented using the core java,  i have used AutoITX4java.jar file to automate the above application. and controlCommandListView options used to click on grid view row item. nothing is working. 
      my question is AutoIT can be used/called directly from java file??? instead of using the AutoITX4java.jar file???
      AutoIT supports GridView automation??? like gridview count and gridivew row item click event automation ect...????
      Any help would be really appricate!!
      Thanks
      Srini
      srini20483@gmail.com