Jump to content

for..to..next with HEX


Recommended Posts

is there any way to make a for to next loop with hex, instead of integers

so like

For $i=00 to FF

solutions are welcome :whistle:

*If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Link to comment
Share on other sites

strange question, for running trought a memory editor that uses hex.

treat the hexvalue as a string, and increment as necessary....

$hex_digits = StringSplit("0123456789ABCDEF")

for each character in the string, right to left

match position w/ index value of hex_digits

if you're at the max, zero current value, and increment next value one.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

strange question, for running trought a memory editor that uses hex.

Okay, that's fine. But why does the For loop have to iterate using Hex instead of decimal? Do you not know how to convert from Decimal to Hex?
Link to comment
Share on other sites

For $i = 0 To 255
    $iHex = Hex($i, 2)
    MsgBox(0, "$iHex", $iHex, 1)
Next

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Link to comment
Share on other sites

  • Moderators

For $i = 0 To 255
    $iHex = Hex($i, 2)
    MsgBox(0, "$iHex", $iHex, 1)
Next
Think your missing Chr() in there :whistle:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...