+ Reply to Thread
Results 1 to 7 of 7

Thread: Get Ini Value......

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2004
    Location
    Eden, Australia
    Posts
    41

    Default Get Ini Value......

    Hi All,

    Trying to get a value from an ini file. I don't get any compile errors but I only ever get back the default value which suggests that its not finding the ini value. I've tried a number of variations in my entry fields. What is the exact syntax required.

    Best Regards,
    Geoff Spillane

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Get Ini Value......

    Hi Geoff,

    For example, to read the Clarion 6.x workdir out of the win.ini file, you can use the following:

    Get INI Value function
    Variable: %TEST%
    Default: 0
    Pathname: %WINDIR%\win.ini
    INI Section: Clarion 6.0 Enterprise Edition
    INI Item: workdir

    The %TEST% variable holds the workdir value. If the call failed, it holds 0 (the Default value). In our latest source codes, the %ERRORCODE% variable is set to -1 if the call failed and 0 if it was successful.

    Does this help?

    Thanks,

  3. #3
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Get Ini Value......

    Correction: If the function succeeds, the %ERRORCODE% value is the number of characters copied to the buffer, not including the terminating null character.

    It is not set to -1 if the function fails.

  4. #4
    Join Date
    Mar 2004
    Location
    Eden, Australia
    Posts
    41

    Default Re: Get Ini Value......

    Hi Friedrich,

    Ok then, I think I was doing it correctly but not getting the results I expected.

    My Test was:
    Variable: %_SB_INSTALLDIR%
    Default: C:\Program Files\My New Directory
    Pathname: E:\My Documents\My SetupBuilder 5 Projects\MyTest.ini
    INI Section: [SetupBuilder] !Note SetupBuilder included the brackets, not me.
    INI Item: InstallDir

    I put a test message window after this with the text being %_SB_INSTALLDIR%

    I compiled and ran a test, and both the test message and the "Destination Window" showed the default path when I knew that both the path and the ini file were correct. Can you see any reason why this would be failing? Any other test I should perform?

    Best Regards,
    Geoff Spillane

  5. #5
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Get Ini Value......

    Hi Geoff,

    Hmm, SB5 included the brackets? Could you please send your script (.sb5) to my private email?

    Thanks,

  6. #6
    Join Date
    Mar 2004
    Location
    Eden, Australia
    Posts
    41

    Default Re: Get Ini Value......

    Hi Friedrich,

    Hmm, SB5 included the brackets?
    Your comment started me doubting myself. With good reason as it turns out. I removed the brackets and it worked. I created a new "Get Ini Value" script, and what do you know; NO BRACKETS!

    I had seen the brackets and I knew I wasn't so stupid as to have included them so it was only logical that SetupBuilder had automatically put them there. Now I know it must have been my wife .

    Sorry for annoying you.

    Best Regards,
    Geoff Spillane

  7. #7
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Get Ini Value......

    Hi Geoff,

    <BG> I am glad that its working fine! Thanks for the update.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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