!str ckey, pwd, hidechar 
!int xpos, ypos, pwdlen
!bool p 

attach "keybuff"
xpos = 10 
ckey = "" 
! 
! the string ~~~ is returned if K_UNDO (ESC) is pressed  
! the string ||| is returned if K_DO (F10) or K_RETURN (Return) is pressed
! 
while ckey <> "~~~" and ckey <> "|||" and xpos < 30 
   ckey = call('charkey')
   !ckey = (*STR) call('charkey')   ! for compiler 
   if  ckey <> "" and ckey <> "~~~" and ckey <> "|||" 
       put at xpos,7 ckey
       xpos = xpos + 1 
       put at xpos+1,7 " " 
   end if 
end while

! 
! Password entry C call. Maximum length of password
! that can be specified is 15 characters. 
! 

pwd = ''
xpos = 21 
ypos = 12 
hidechar = '-'
pwdlen = 5       ! specify length of password 

put at 5,12 'Enter Password: ' 
pwd = call('passw',xpos,ypos,hidechar,pwdlen)
!pwd = (*STR) call('passw',xpos,ypos,hidechar,pwdlen)   ! for compiler
if  length(pwd) > 0
    if  pwd = '???'
        put at 5,14 'HELP KEY was pressed'
    else if pwd = '~~~'    
        put at 5,14 'ESC KEY was pressed'
    else    
        put at 5,14 'The password is : ', pwd
    end if    
    p = true
    get p 
end if 
detach "keybuff"
