Results 1 to 4 of 4

Thread: Sub Keys in an INI file

  1. #1
    johnweidauer
    Guest

    Sub Keys in an INI file

    I have a small program to build but i want to avoid a database. I will have a list of residents (10 in total) that i want to keep detail on. can i nest keys inside an INI file:

    [Residents]
    [Resident0001]
    [Room#] = ##
    [etc.] = "an on and on"
    [Resident0002]
    [Room#] = ##
    [etc.] = "an on and on"
    [Resident0003]
    [Room#] = ##
    [etc.] = "an on and on"

    If you can, I need help on the syntax, if not, it figures.

    Thanks

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    group your data by the delimiter of ; or , with a single key like:

    [Residents]
    ; Subkey = Room#;etc
    Resident0001=#1;an on an on
    Resident0002=#2;an on an on
    Resident0003=#3;an on an on

    then juz split the data with the Split function

  3. #3
    Addicted Member
    Join Date
    Jun 2002
    Location
    Brisbane Australia
    Posts
    150
    have you thought about using the Random FIle Format thats been with Basic since GW basic in the 80's. Its flexible, bit old fashoined, but for what you are trying to achieve, it's what I would use and still works with VB !!

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    for random file, you need to define your data structure at the first place


    VB Code:
    1. Private Type MyRecord
    2.     RoomNo As Integer
    3.     Etc As String * 128
    4. End Type

    But with this, you need to fixed the string length, for shorter reading time.

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