home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / fax_se1r / modmake.bas < prev    next >
Encoding:
BASIC Source File  |  1999-08-21  |  928 b   |  34 lines

  1. Attribute VB_Name = "modMake"
  2. 'If you are going to use this in a app, you must
  3. 'first contact me at aandrei@hades.ro, and you
  4. 'have to credit me on the application's box, and/or
  5. 'about box
  6.  
  7. Sub AddToSelfExtract(SelfExtract As String, WhatFile As String, SaveAs As String)
  8.  
  9. Dim iFreeFile As Integer
  10. Dim iFreeFile2 As Integer
  11. Dim sBuffer As String
  12. Dim sBefore As String
  13.  
  14. iFreeFile = FreeFile
  15.  
  16. Open SelfExtract For Binary As iFreeFile
  17.     sBefore = String(LOF(iFreeFile), Chr(0))
  18.     Get iFreeFile, , sBefore
  19. Close iFreeFile
  20.     
  21.  
  22. Open SaveAs For Output As iFreeFile
  23.     iFreeFile2 = FreeFile
  24.     Open WhatFile For Binary As iFreeFile2
  25.         sBuffer = String(LOF(iFreeFile2), Chr(0))
  26.         Get iFreeFile2, , sBuffer
  27.         Size = LOF(iFreeFile2)
  28.         Size = String(10 - Len(Size), "0") & Size
  29.         Print #iFreeFile, sBefore & sBuffer & Size
  30.     Close iFreeFile2
  31. Close iFreeFile
  32.  
  33. End Sub
  34.