home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 25 / IOPROG_25.ISO / SOFT / STAMP.ZIP / CODEIT.PRG next >
Encoding:
Text File  |  1989-05-11  |  1.2 KB  |  41 lines

  1. * Program Name: codeit.prg 
  2. * Author: Dave Irwin 
  3. * Copyright (c) 1989 by Software Solutions 
  4. *-----------------------------------------------------------------------------
  5. * Created: 5/11/1989 at 10:51
  6. *---------------------------- ALL RIGHTS RESERVED ----------------------------
  7. * Routines used in both SERIAL.PRG and TEST.PRG
  8. FUNCTION Serialnum
  9.     parameters f_file, f_serial
  10.     * you may wish to encrypt f_serial here!
  11.     memowrit("SERIAL.TXT", f_serial)
  12.     RUN COPY /b &f_file. + Serial.txt &f_file. > NUL
  13. RETURN((ERRORLEVEL() = 0))
  14.  
  15. FUNCTION Getserial
  16.     parameters f_handle, s_length
  17.     backtrack = (s_length + 1) * -1
  18.     fseek(f_handle, backtrack, 2)
  19.     oldstr = freadstr(f_handle, s_length)
  20.     * If you encrypted above, be sure to un-encrypt here!
  21. return(oldstr)
  22.  
  23. PROCEDURE GETID
  24. * READS THE SERIAL NUMBER AND FILE SERVER FROM AN EXE FILE!
  25.  
  26. PARAMETERS file, mSERIAL, mFS_NAME
  27.  
  28. mSERIAL = SPACE(15)
  29. mFS_NAME = space(48)
  30. TT_SERIAL = mFS_NAME + mSERIAL
  31.  
  32. fhandle = fopen(file)
  33. the_number = GETSERIAL(fhandle, LEN(TT_SERIAL))
  34. mFS_NAME = LTRIM(RTRIM(SUBSTR(the_number,1,48)))
  35. mSERIAL  = LTRIM(RTRIM(SUBSTR(the_number,49)))
  36. RETURN
  37.  
  38. *** EOF ***
  39.  
  40.