Results 1 to 3 of 3

Thread: Please could someone help me - Associating a file with your program.

  1. #1

    Thread Starter
    Addicted Member RCharlton's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    202

    Post

    I am making a perl editor which requires a text box in which you write the code. Perl files come with the extensions (.pl) & (.CGI). Please could someone tell me how I could make it so when someone clicks on a .pl file, my program opens (I can get this far) but with the text box containing the file contents

    Thank you

    Richard Charlton

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    use Command() to grab command line parameters which should be the filename of the file you want to open then read it into the text box


    eg:
    Code:
    Option Explicit
    
    Private Sub Form_Load()
    Dim filename As String
    Dim fnum As Byte
    Dim strtemp As String
     filename = Command()
    If filename <> "" Then
      fnum = FreeFile
     
      Open filename For Binary As fnum
       strtemp = Space(LOF(fnum))
       Get fnum, , strtemp
       Close fnum
      End If
      
       Text1.Text = strtemp
    End Sub
    Mark
    -------------------

  3. #3

    Thread Starter
    Addicted Member RCharlton's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    202

    Post

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width