User Tag List

Results 1 to 5 of 5

Thread: Proper syntax for INI++ conditions

  1. #1
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Sep 2010
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Proper syntax for INI++ conditions

    Alright. I have (hopefully) learned how to successfully save data using the INI++ object. I am trying to figure out how to load the data from the INI file into the global strings/values in my application.

    For example, a portion of my .ini file looks like this:

    [CHARACTER]
    a1. Name=Billy
    b1. Level=2

    As you can see, the Character group contains 1 string and 1 value. I have a condition set up to load the open dialogue box using the Common Dialogue Object. Upon finding the .ini file, I want the global value for level and the global string for name to be filled with the information contained in the .ini file. I do not know the syntax for this. Can someone help me figure this out please?

    Thank you

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Proper syntax for INI++ conditions


    Set Global Value A to GetItemValue( "Ini++", "CHARACTER", "b1. Level", 0)

    Set Global String A to GetItemString$( "Ini++", "CHARACTER", "a1. Name", "")

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Sep 2010
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Proper syntax for INI++ conditions

    okay thank you But if I use it like that, regardless of what the value is in the ini file, or what the string is....the string will always come back as "" and the value will always come back 0

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Proper syntax for INI++ conditions

    Are you sure you're loading the INI file into Ini++? It first needs to know what INI file to access... If you're just using the common dialogue object to pick the ini file, it isn't actually setting that file to work with Ini++

    I just tested it out and it worked fine by simply loading the ini file directly with Ini++ from an event.

    With the common dialog object you'd want to do an event like:

    Open Dialog - OK

    Then for the action, you go to the Ini++ object and choose Load File and then click the Expression button and insert:

    GetFilename$( "Common Dialog object" )

    That way it's loading your chosen file into the Ini++ object to use.

    From there you can use the syntax I posted in the previous post to access the variables. I tested this all out and it worked fine.

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Sep 2010
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Proper syntax for INI++ conditions

    Thank you I got it to work *__*

Similar Threads

  1. Importing PNG with proper transparency
    By wie7nightmare in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 9th July 2013, 07:20 PM
  2. Tearing hear out over Order. Proper way to do it?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 28
    Last Post: 3rd July 2013, 09:56 AM
  3. Proper scaling for 3rd gen iPod?
    By PacoStudios in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 29th December 2012, 10:00 AM
  4. Proper wav format
    By willy in forum XNA Export Module Version 2.0
    Replies: 2
    Last Post: 14th June 2011, 07:48 PM
  5. Counter not displaying proper number
    By jellytot in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd January 2009, 09:11 AM

Posting Permissions

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