Jump to content
Sign in to follow this  
Cap0

string/mem help

Recommended Posts

Cap0

What's the difference between:

_MemWrite($open,0xbase,_MemCreate(0x40))

This works, but this doesnt:

Dim $a
$a = "0x" & "40"
_MemWrite($open,0xbase,_MemCreate($a))

this doesn't work

Share this post


Link to post
Share on other sites
PsaltyDS

What's the difference between:

_MemWrite($open,0xbase,_MemCreate(0x40))

This works, but this doesnt:

Dim $a
$a = "0x" & "40"
_MemWrite($open,0xbase,_MemCreate($a))

this doesn't work

$a was set to a string "0x40" instead of the number 0x40. This should work:

Dim $a
$a = 0x40
_MemWrite($open,0xbase,_MemCreate($a))

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Cap0

Hi,

works good, but how do i make this string:

$string = "0x40,0x30,0x20,0x10"

not a string? but like 0x40 0x30 etc..?

Share this post


Link to post
Share on other sites
PsaltyDS

Hi,

works good, but how do i make this string:

$string = "0x40,0x30,0x20,0x10"

not a string? but like 0x40 0x30 etc..?

You can't. Actual integer parameters are not passed that way. Either they will be completely separate parameters:

_MyFunc(0x40, 0x30, 0x20, 0x10)oÝ÷ Úíì°Y[z¬±çb©Ú®¶²jëh×6Dim $avParams[4] = [0x40, 0x30, 0x20, 0x10]
_MyFunc($avParams)

If you pass them as string like yours, then the function receiving the string will just have to do the work to break them out and convert into separate integers again. No big deal if it's your function, but most functions that need integers expect to receive integers.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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
Sign in to follow this  

×