Metropoli BBS
VIEWER: scanf.asm MODE: TEXT (ASCII)
include qlib.inc
include string.inc
include stdio.inc
include conio.inc

.data
  str1 db 80 dup (0)
  str2 db 80 dup (0)
  dw1 dd 0
  dw2 dd 0
  dw3 dd 0
  f1 real8 0.0
.code
main proc
  call clrscr

  callp print,"Testing sscanf ...\n\n"

  callp sscanf,"The String\0011 with numbers in it\0 567567 0x400", \
    "%s%b%s%d%x",offset str1,offset dw1,offset str2,offset dw2,offset dw3

  callp printf,"string = \"The String\\0011 with numbers in it\\0 567567 0x400\"\n\n"
  callp printf," str1  = %s \n",offset str1
  callp printf," dword1= %i \n",dw1
  callp printf," str2  = %s \n",offset str2
  callp printf," dword2= %i \n",dw2
  callp printf," dword3= %i \n",dw3

  callp printf,"Enter a float:"
  callp scanf,"%f",offset f1

  callp printf,"\n float = %f\n",f1
  callp printf," float(0) = %x\n",dptr [f1]
  callp printf," float(4) = %x\n",dptr [f1+4]

  ret
main endp

end

[ RETURN TO DIRECTORY ]