Results 1 to 4 of 4

Thread: [RESOLVED] Ini file / Multiple entries in a key name

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Resolved [RESOLVED] Ini file / Multiple entries in a key name

    Using GetPrivateProfileString I load some data from a ini file.

    I would like to include, under the same key name a number of strings to be assigned to a string array of variable dimension. How do I specify the key name (or how do I loop) so that all lines below (until the next key name) are read and assigned to the different array elements?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2

  3. #3
    Hyperactive Member
    Join Date
    Sep 2009
    Location
    Lost in thought
    Posts
    349

    Re: Ini file / Multiple entries in a key name

    You can,
    Code:
    StringArray1 =Join(aStringArray1, ";")
    
    'WritePrivateProfileString Section, Key, Value, Filename
    WritePrivateProfileString "MyStringArrays", "StringArray" & 1, StringArray1, app.Path & "/A.ini"
    
    'GetPrivateProfileSection(Section, Key, tDefault, RetVal, BufferLen, Filename)
    
    GetPrivateProfileSection "MyStringArrays", "StringArray" & 1, " ",TempStringArray ,?,app.Path & "/A.ini"
    
    aStringArray1 =Split(TempStringArray, ";")
    .

    The answer to your question is Here
    And here
    C:\Program Files\Microsoft Visual Studio\MSDN98\98VSa\1033\SAMPLES\VB98

    Please go to the "Thread Tools" menu at the top of this Thread, and click "Mark Thread Resolved" when you have your answer.
    So I can fine the answer when I need it.

    how to stop the playsound when it is in loop..Play more than 1 sound at a time..
    ini file Check if IP changed Strings 'Split', 'Left' and 'Right'
    Save And Load an Array of list-boxes, to and from a file......list-box and CommonDialog
    Quote Originally Posted by RobDog888

    So please install VB6 service pack 6 as its the latest and last supported service pack MS will ever make.
    http://support.microsoft.com/kb/q198880/ I'm sure this will fix your issue
    The only reason some people get lost in thought is because it’s unfamiliar territory. —Paul Fix

  4. #4

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Ini file / Multiple entries in a key name

    So both of you guys suggest the same straightforward solution. The easier it turns out to be the less likely I am to think of it myself

    Thanks be to you both.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

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