home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a085 / 1.ddi / UNLOCKDB.PRG < prev   
Encoding:
Text File  |  1994-01-12  |  1.1 KB  |  36 lines

  1. *⌐░⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐┤ 
  2. *⌐ª      Program: UNLOCKDB.PRG                                         ⌐ª
  3. *⌐ª     Function: ╩╣╙├ LLIO ║»╩²░╤╩²╛▌┐Γ╘¡┐¬═╖╡─╡┌╥╗╕÷╫╓╜┌╨┤╗╪,        ⌐ª
  4. *⌐ª               ╥╘╜Γ│²▒ú╗ñ╡─╖╢└².                                    ⌐ª
  5. *⌐ª        Usage: =UNLOCKDB("Database name")                           ⌐ª
  6. *⌐╕⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐╝
  7. FUNCTION unlockdb
  8. PARAMETERS file_name
  9. PRIVATE file_name, file_alias, handle, keybyte
  10.  
  11. IF AT(".",file_name) = 0
  12.    file_alias = file_name
  13.    file_name = file_name + ".DBF"
  14. ELSE
  15.   file_alias = SUBSTR(file_name,1,AT(".",file_name)-1)
  16. ENDIF
  17.  
  18. handle = FOPEN(file_name,2)
  19.  
  20. IF handle = -1
  21.    WAIT "UNLOCKDB() ╬▐╖¿╨┤╗╪╥╤┤≥┐¬╩²╛▌┐Γ " + file_alias +;
  22.         " ┐¬═╖╡─╡┌╥╗╕÷╫╓╜┌."
  23.   RETURN(.F.)
  24. ENDIF
  25.  
  26. * ╢┴╚í▒φ═╖╡─╡┌╥╗╕÷╫╓╜┌
  27. keybyte = FREAD(handle,1)
  28. * ╜½╬─╝■╓╕╒δ╥╞╗╪╡┌╥╗╕÷╫╓╜┌
  29. = FSEEK(handle,0)
  30. * ╙├▒╚╘¡└┤╡═┴╜╬╗╡─ ASC II ╫╓╖√╨┤╗╪
  31. = FWRITE(handle,chr(asc(keybyte)-2))
  32. * ╣╪▒╒╬─╝■
  33. = FCLOSE(handle)
  34.  
  35. RETURN(.T.)
  36.