AlmarM Posted November 17, 2008 Posted November 17, 2008 (edited) Hi, Why does my var returns '0'? $a = Number(00000000) MsgBox(0, "", $a) $b = 00000000 MsgBox(0, "", $B) $c = ClipPut(00000000) MsgBox(0, "", ClipGet()) I want it to return '00000000'. AlmarM Edited November 17, 2008 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
oMBRa Posted November 17, 2008 Posted November 17, 2008 $a = Number(00000000) MsgBox(0, "", $a) $b = 00000000 MsgBox(0, "", $b) $c = ClipPut('00000000') MsgBox(0, "", ClipGet())
Richard Robertson Posted November 17, 2008 Posted November 17, 2008 000000 = 0. "000000" = "000000" Numbers don't save superfluous zeros.
AlmarM Posted November 17, 2008 Author Posted November 17, 2008 Arg >.<... I need 00000000 then +1 (00000001) etc. Until 99999999 AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
DaleHohm Posted November 17, 2008 Posted November 17, 2008 (edited) $x = 1 $c = ClipPut(StringFormat("%08s\n", $x)) MsgBox(0, "", ClipGet()) Edited November 17, 2008 by DaleHohm Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
AlmarM Posted November 17, 2008 Author Posted November 17, 2008 (edited) Whahaha, I fixed it with an other way. AlmarM Edited November 17, 2008 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
AlmarM Posted November 17, 2008 Author Posted November 17, 2008 I did it this way: (FileWrite is because the example) $i = 0 While 1 _Check($i) FileWrite(@DesktopDir & "\Test.txt", $i & @CRLF) $i += 1 If $i = 99999999 Then Msgbox(0, "", "Done!") Exit EndIf WEnd Func _Check($i) If StringLen($i) = 2 Then FileWrite(@DesktopDir & "\Test.txt", "000000") ElseIf StringLen($i) = 3 Then FileWrite(@DesktopDir & "\Test.txt", "00000") ElseIf StringLen($i) = 4 Then FileWrite(@DesktopDir & "\Test.txt", "0000") ElseIf StringLen($i) = 5 Then FileWrite(@DesktopDir & "\Test.txt", "000") ElseIf StringLen($i) = 6 Then FileWrite(@DesktopDir & "\Test.txt", "00") ElseIf StringLen($i) = 7 Then FileWrite(@DesktopDir & "\Test.txt", "0") ElseIf StringLen($i) = 8 Then FileWrite(@DesktopDir & "\Test.txt", "") Else FileWrite(@DesktopDir & "\Test.txt", "0000000") EndIf EndFunc AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.
youknowwho4eva Posted November 17, 2008 Posted November 17, 2008 wouldn't a for or do loop be easier? Giggity
Nevin Posted November 17, 2008 Posted November 17, 2008 I only used While loops for a couple years. I understood how they worked and the other ones scared me. More work, but if it gets the job done, whatever.
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