Hi,
I was just wondering if it were possible for me to convert a ASCII (byte value) number, such as 12345 into the same value in WORD.
For example, i would like my users to enter a number in a editbox, but how would i then convert this into a 16bit value?
i was thinking something like word ptr , but i don't think that does what i want it to...
any help will be greatly appreciated!!!
I was just wondering if it were possible for me to convert a ASCII (byte value) number, such as 12345 into the same value in WORD.
For example, i would like my users to enter a number in a editbox, but how would i then convert this into a 16bit value?
[...]
.data?
buffer BYTE 256 dup(0)
.code
invoke GetWindowText, hEdit, addr buffer, 256
;trim the buffer
mov myvalue, [buffer] <-----how would i make the number in 'buffer' become a WORD value?
i was thinking something like word ptr , but i don't think that does what i want it to...
any help will be greatly appreciated!!!
If your using masm32 use atodw
invoke atodw,ADDR MyAsciiNumber
eax contains the DWORD value so just mov ax
mov MyWORDNumber,ax
invoke atodw,ADDR MyAsciiNumber
eax contains the DWORD value so just mov ax
mov MyWORDNumber,ax
If your Edit control is in a dialog box, you could retrieve the binary number with the GetDlgItemInt function.
Raymond
Raymond
If your using masm32 use atodw
invoke atodw,ADDR MyAsciiNumber
eax contains the DWORD value so just mov ax
mov MyWORDNumber,ax
ah, i c, many thanks :) i will test it out shortly
Thanx!