[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

2538.0. "help reading variable length files from vb" by HIGHD::MELENDEZ () Wed Apr 23 1997 18:31

    Hello
    I am in the process of writting a VB 4 based application to 
    interface with an old dos based fortran program.  I have
    a need to read file output from the dos program and then
    place the information into tables.  I have defined  3 types 
    which defines the various data in one file. The file contains
    records of various sizes the first record is 58 bytes long.
    The second is 115 bytes long and the third is 75 bytes long.
    I defined all the data to be input as string in the type.
    I would then convert numbers to be numbers as needed.
    my questions relate to the use of VB to read a file that 
    is  has variable record lengths.
    1. I am opening the file as binary, should I be using
    	some other method.
    2. In the type session are the variables define in the type 
        usable as defined in the type or do I have to dim a new variable
    3. when I read the data I would like be able to place the information
     directly into and database (oracle) with an asignment of the variable
    name from the type statement to a text of a sql statement.
    4. I am using a get statement to move the data into a array
    of the type I have created, and a put statement to write it out to
    a file.  I have also been using a print using debug to see if I can 
    get at the data. are there any other ways to debug this kind of
    problem.
    I am reading the first record then performing a for next loop to read all
    the records to the last one then save the count and subtract 1 and then
    read the last record, this is a dumb way to go but I have found no
    other options for this read.
    This seems to be such a simple thing to do but I am having more
    problems than I expected,  any help would be greatly appreciated
    Jose Melendez@cko 
T.RTitleUserPersonal
Name
DateLines