qwertylol Posted June 1, 2007 Share Posted June 1, 2007 4.9.1.2.3.3.4.0.0.4.2.3.4.9.8.4.0.0.0.0.4.2.3.4.9.0.0.0.2.3.8.3.2. how do I add the numbers above together? exp, a shorter version: 4.9.1.2.3.3 the sum is 22. Link to comment Share on other sites More sharing options...
jefhal Posted June 1, 2007 Share Posted June 1, 2007 (edited) $var = "4.9.1.2.3.3.4.0.0.4.2.3.4.9.8.4.0.0.0.0.4.2.3.4.9.0.0.0.2.3.8.3.2" $out = StringReplace($var,".","+") If StringRight($out,1) = "+" Then $out = StringLeft($out,StringInStr($out,"+",0,-1)-1) EndIf MsgBox(1,"$out",$out) $sum = Execute($out) MsgBox(1,"$sum",$sum) Edited June 1, 2007 by jefhal ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
1905russell Posted June 1, 2007 Share Posted June 1, 2007 4.9.1.2.3.3.4.0.0.4.2.3.4.9.8.4.0.0.0.0.4.2.3.4.9.0.0.0.2.3.8.3.2. how do I add the numbers above together? exp, a shorter version: 4.9.1.2.3.3 the sum is 22.This is the simplest way $iSum =(4+9+1+2+3+3) msgbox(0,"",$iSum) Link to comment Share on other sites More sharing options...
qwertylol Posted June 1, 2007 Author Share Posted June 1, 2007 This is the simplest way $iSum =(4+9+1+2+3+3) msgbox(0,"",$iSum) AHAHAHAHAHAAHA no, please try again, with automatic addition this time Link to comment Share on other sites More sharing options...
1905russell Posted June 1, 2007 Share Posted June 1, 2007 AHAHAHAHAHAAHA no, please try again, with automatic addition this time How about $iSum = Stringsplit("4.9.1.2.3.3",".") $iTot = 0 For $icount = 1 to $iSum[0] $iTot += $iSum[$icount] next msgbox(0,"",$iTot) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now