LibertyMan Posted April 8, 2010 Share Posted April 8, 2010 First thank you for looking at my topic, and i've been delete this over and over if $Whatever = 0 then $whatever = 0 ElseIf $Whatever = -1 then $Whatever = 25 ElseIf $Whater = -2 then $whatever = 24 EndIf Is there any way to speed this up? Some more simple few lines and not 50+ lines? Thanks, LibertyMan Link to comment Share on other sites More sharing options...
bogQ Posted April 8, 2010 Share Posted April 8, 2010 You did not tell what do you need, we can't look in cristal ball to finde out what the 50+ lines present So put the script with the problem and explaind where is the problem. Looking your 7 lines presentation the only thing that can hit my brain is $Whatever = -8;put heare number for testing O_o if $Whatever = 0 then $whatever = 0 Else $Whatever = $Whatever + 26 EndIf MsgBox(0,"",$Whatever) If it dont help you try next time to put some more info and you have link that can help you with your title in my sig. TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
jchd Posted April 8, 2010 Share Posted April 8, 2010 (edited) It depends which values you want. If you mean that the resulting value should be: 0 if input is zero 25 if input is -1 24 if input is -2 23 if input is -3 22 if input is -4 and so on, you can simply do If $Whatever < 0 Then $Whatever = 26 + $Whatever Or is your actual problem different? Edited April 8, 2010 by jchd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
LibertyMan Posted April 8, 2010 Author Share Posted April 8, 2010 (edited) Thank you for trying to help me. Na, I already have the numbers there 0,-1,-2,-3,-4,-5,-6,...(-25) I want to change them like so, If $whatever = 0 then $whatever = 0 ElseIf $whatever = -1 then $whatever = 25 endif Do i have to do the same all the way through or something more simple like.. "Jchd" - I think your right but.. If $whatever > 0 then $Whatever = 26 + $Whatever Ill go test now. Edited April 8, 2010 by LibertyMan Link to comment Share on other sites More sharing options...
LibertyMan Posted April 8, 2010 Author Share Posted April 8, 2010 (edited) Yes Jchd, your right, and thank you. + for you trail's and error's gets the job done Edited April 8, 2010 by LibertyMan Link to comment Share on other sites More sharing options...
jchd Posted April 8, 2010 Share Posted April 8, 2010 It's the same that BogQ posted seconds before me.But you changed the meaning of the test: if ___ > 0 won't work.BTW, you can also writeIf $whatever < 0 then $Whatever += 26Programming isn't trial and error. It's about making it right the first time (most of the times ). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) 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