dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: reading a text

  1. #1
    Raymond Guest

    reading a text


    I have seen another program that uses
    substr(file,spaces over,number of characters to capture)
    I wanted to know. Can VB do the same? If so, what command and
    how.


    Thanks


  2. #2
    Ian Williams Guest

    Re: reading a text

    Raymond

    It depends on whether the 'file' in that call is:

    a) a prefilled variable

    or

    b) an actual file on the hard drive

    a)
    Dim strSubString
    strSubString ) = Mid$(file, <spaces over>, <number of characters>)

    b)
    Dim fnum As Integer
    Dim strBuffer As String
    fnum = FreeFile
    strBuffer = Space$(<number of characters>)
    Open "<file>" For Binary As fnum
    Get #fnum, <spaces over>, strBuffer
    Close #fnum

    regards

    Ian

    ** invalid email address, change dk to denmark

    homepage http://www.kingsoft-denmark.com/
    Tips & Tricks page http://tips.kingsoft-denmark.com/

    "Raymond" <tempist@fibeia.com> wrote in message
    news:3babfcc8$1@news.devx.com...
    >
    > I have seen another program that uses
    > substr(file,spaces over,number of characters to capture)
    > I wanted to know. Can VB do the same? If so, what command and
    > how.
    >
    >
    > 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center