SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Dec 2001
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rules about INI file contents


    I am not sure about how INI file contents
    should be arranged.

    I could not find documentation as to find how one could enter comments inside an INI file.

    for eg. I could read something like

    [section-1]
    //a=v
    #a=v1

    using the name "//a" and "#a" instead of
    "a".

    Secondly if I have entries like

    a=1
    a=2

    Now I cannot read the value of a at all.
    Why ? How is this value read implemented ?
    Any ideas /

    -

    ------------------

  2. #2
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Rules about INI file contents

    I'm not having any problems.

    I setup a ini file like:
    [Section-1]
    //a=v
    #a=v1
    a=1
    a=2

    used the following code:
    HINIFILE hIniFile = IniFileOpen ("c:\test.ini");
    string sValue = IniFileGetValue (hIniFile, "Section-1", "//a");
    IniFileClose(hIniFile);
    print(sValue);

    this would return a value of v1. If I used "#a" in the name parameter, it would return a value of v2. if I used "a" in the name parameter, it would return a value of 1 and ignore the 2nd "a=" in the ini file.

    I'm using version 5.0.2

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  3. #3
    Senior Member
    Join Date
    Aug 1999
    Location
    San Diego, CA USA
    Posts
    219
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Rules about INI file contents

    INI files are not a Segue/SilkTest created thing. They're a standard Windows (perhaps rooted in Unix) file format. I've been familiar with the format for so long that I am definitely NOT a good tester of Segue's documentation from a newbie's perspective. I did a quick search in Win2K's Help but didn't find much there to help, but I'm sure more beginner-level info is available somewhere.

    Everything in the previous response is as it should be.

    Why would you want two a= lines anyway? Perhaps you might want the same variable (a) defined in different sections [section] of the file (I do this), but in the same section it makes no sense.

    ------------------

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Rules about INI file contents

    If you're trying to comment something out, I believe that you use a semi-colon at the beginning of the line. For example, in the ini file:
    In the above, if you use "a" as the value to get in IniFileGetValue, "3.15" will be returned. If you try to get "&#59;a" nothing will be returned because, technically, that value doesn't exist in the .ini file; it's commented out.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:43 PM.

Copyright BetaSoft Inc.