Results 1 to 4 of 4

Thread: geting varibles from an external file

  1. #1

    Thread Starter
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    Use the VB File Functions, Open.. For.. As.., eg.
    Code:
    Dim iFile As Integer
    iFile = FreeFile
    Open "C:\TheFile.txt" For Input As iFile
        Input #iFile, sWebURL
    Close iFile
    Msgbox "The URL is " & sWebURL
    If the file contains more than one bit of information, you would continue to use the Input# function until EOF(iFile) is True indicating the End of the File has been Reached.

    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    adyoung@win.bright.net


    [This message has been edited by Aaron Young (edited 12-13-1999).]

  2. #2
    New Member
    Join Date
    Aug 1999
    Location
    uk
    Posts
    7

    Post

    Thanks this worked great. However how do i code the path to the file so it will be relative to my exe file?

  3. #3

    Thread Starter
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    The App.Path Property will contain the Directory Path from which your Application was launched.

    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    adyoung@win.bright.net

  4. #4
    New Member
    Join Date
    Aug 1999
    Location
    uk
    Posts
    7

    Post

    Hi all
    i need to read a file which will contain some varibles e.g a web address. How do i open the file read in the web address and put this address into a varible? The file it will open is a plain text file only containing on line which id the web address.

    Andy@webfx3.freeserve.co.uk

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