w0uter Posted July 4, 2005 Share Posted July 4, 2005 (edited) remember doing it in java using the % operator. i didnt understand it so i made it in autoit ;=============================================================================== ; ; Description: Returns the sum of all didgits. ; Syntax: $var = _DSum( "1b2l3a456789" ) ; Parameter(s): $i_n - String/Digits to add up to eachother. ; Requirement(s): None ; Return Value(s): Returns the sum of all didgits. ; Author(s): w0uter ; Note(s): None ; ;=============================================================================== Func _DSum($i_n) Local $i_r = 0 $i_n = StringSplit($i_n & '', '') For $i_c = 1 To $i_n[0] $i_r += $i_n[$i_c] Next Return $i_r EndFunc;==> _DSum() Edited July 4, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll 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