Simple file specification

Discussion in 'AutoCAD' started by Mark Gardiner, Jul 10, 2003.

  1. Hi all,

    I am writing a VB app to do some design calcs. I need to store 3 or 4
    different objects to file.Can any one point me to some good references /
    examples of the best way to do this?
    Storing the data in a drawing is not an option as acad may not be running on
    the machine.

    Thanks
    Mark
     
    Mark Gardiner, Jul 10, 2003
    #1
  2. Mike Tuersley, Jul 10, 2003
    #2
  3. Hi,

    Maybee I should not have used the word simple.

    I need to save a fixed set variables of types string, double, single &
    boolean. The 3 different sized arrays that will also vary in size from job
    to job. The arrays are of different types defined by the 'public type' . . .
    'end type' statements. the elements of the types can contain different data
    of double, single, interger & boolean.

    I am tying to work how one should go about saving data like this to file?

    Thanks
    Mark
     
    Mark Gardiner, Jul 10, 2003
    #3
  4. Mark Gardiner

    Kevin Terry Guest

    You could store everything in an array of variants, then use this:

    Public Sub WriteArray(strFile As String, varList As Variant)
    On Error Resume Next
    Dim intFile As Integer
    intFile = FreeFile
    Open strFile For Binary As intFile
    Put intFile, , varList
    Close intFile
    On Error GoTo 0
    End Sub


    Kevin
     
    Kevin Terry, Jul 10, 2003
    #4
  5. The data type don't matter because they're all going to be strings if
    you save them to an external file. Also, don't use arrays - use either
    collections or FSO dictionaries. Then use the INI and have each section
    be a collection/dictionary. Another method would be to use XML - there
    are plenty of examples of that around just go to Codehound and do
    search.
    ___________________________
    Mike Tuersley
    AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Jul 10, 2003
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.