hi guys
I have a question about GetDlgItemText!
How can I check if a valid number or a valid letter ?
greets
ragdog
i have this found
this works
invoke GetDlgItemText,hWnd,1002,addr lpBuffer,10
mov ebx,offset lpBuffer
.if (byte ptr [ebx] >= '0' && byte ptr [ebx] <= '9' )
invoke MessageBox,hWnd,addr szValid,0,MB_OK
.else
invoke MessageBox,hWnd,addr szInvalid,0,MB_OK
.endif
Why does this not work??
invoke GetDlgItemText,hWnd,1002,addr lpBuffer,10
mov ebx,offset lpBuffer
.if (byte ptr [ebx] >= '0' && byte ptr [ebx] <= '9' && byte ptr [ebx] >= 'A' && byte ptr [ebx] <= 'Z')
invoke MessageBox,hWnd,addr szValid,0,MB_OK
.else
invoke MessageBox,hWnd,addr szInvalid,0,MB_OK
.endif
thanks in forward
ragdog,
Look closer...
X = '2'
if (X >= '0' and X <= '9' and X >= 'A' and X <= 'Z')
; do this
endif
Should be..
X = '2'
if (X >= '0' and X <= '9') or (X >= 'A' and X <= 'Z')
; do this
endif
thanks for your reply
If I use when I get compile this error message:
error A2154: syntax error in control-flow directive :'(
Quote from: ragdog on January 28, 2008, 01:31:08 AM
If I use when I get compile this error message:
error A2154: syntax error in control-flow directive :'(
Did you took what I wrote as it is :eek
It was pseudo code. The MASM code is...
.if (byte ptr [ebx] >= '0' && byte ptr [ebx] <= '9') || (byte ptr [ebx] >= 'A' && byte ptr [ebx] <= 'Z')
:bdg
Thanks this works :U
best regard
ragdog