HI i am having trouble with my display box.? I can only get 9 numbers displayed and when i try to display the 10th number it displays ERROR on my display window

Here is the code
.if eax == 0
invoke SetWindowText,hDspl,Button? ? ? ? ? ? ? ? ? ;if nothing is in eax its going to display the number that was pressed
? ? ? ? ? ? ? ? ? ?                                                                    ; which works fine? ? ? ? ? ? ? ? ? ? ? ? ? ?
.elseif

invoke GetWindowText,hDspl,ADDR buffer,512                ;  gets what was previously in display window as a string
invoke FpuAtoFL,addr buffer,0,DEST_FPU                   ;  puts it on the stack
fld movingn                                                                  ;  puts 10 on the stack
fmul                                                                            ;  multiplies the number so it moves it over a place
fiadd number                                                                ;  adds the number so it builds up the number
invoke FpuFLtoA, 0,ADDR number4, ADDR result_0, SRC1_FPU or SRC2_DMEM  ;suppose to put the relsult in 
invoke SetWindowText,hDspl,ADDR result_0                                                  ;displays the result which works fine upto the 10th 
                                                                                                                                  ;number 


.endif


can anyone tell me why it displays ERRRO on my window when the number gets to be 10 digits long?
Also could i have added the number to the string that is stored in buffer?  for example if the buffer has stored 511 as a string and they press 3 could i just add the 3 to the 511 string so i would get 5113.  Does a command exist for this. 

thanks slim
Posted on 2005-07-05 21:32:25 by slim515
hey guys i got it working.  But does anyone know how i can add the number to the string that is stored in buffer?  for example if the buffer has stored 511 as a string and they press 3 could i just add the 3 to the 511 string so i would get 5113.  Does a command exist for this? 
Posted on 2005-07-05 21:52:10 by slim515
I don't know how the 'FpuFLtoA' works, but about you last question: well if out use the pointer which is larger by 3, you'll adress bytes starting from the 3rd digit of your string.

example:

blah ?db 10 DUP (?)


mov eax, someValue
mov , eax ? ? ; address first 4 bytes at 'blah'
mov , eax ; address second 4 bytes at 'blah+4'
etc.

if the first bytes hold string letters, then ou can append your new string this way (of course you have to use its ASCII code, not just the plain number, and you must zero-terminate the string).

(this is tasm's 'ideal mode' syntax, but the idea is always the same)
Posted on 2005-07-05 21:57:19 by ti_mo_n