Forum Discussion

DevaV's avatar
DevaV
Contributor
14 years ago

Using INI Files in Stores

Hi,



We have added new ini file to the stores. When it is imported it gets imported with appending _INI at the end of name.In scripts when we have used following ways, it dont returns a value.





//Sample -1

var iniFilePah = Storages.INI.("Test.INI")

Log.Message(iniFilePath.GetSubSection("IDC_STATIC_PROPERTIES").GetOption("English", "Not Exists")); //It prints Not Exists



//Sample -2

var iniFilePah = Storages.INI.("Test_INI.INI")

Log.Message(iniFilePath.GetSubSection("IDC_STATIC_PROPERTIES").GetOption("English", "Not Exists")); //It prints Not Exists



//Sample -3

var iniFilePah = Storages.INI.("Test_INI")

Log.Message(iniFilePath.GetSubSection("IDC_STATIC_PROPERTIES").GetOption("English", "Not Exists")); //It prints Not Exists



//Sample -4 - It access the same file but not stored in stores

var iniFilePah = Storages.INI.("E:\\Test.INI")

Log.Message(iniFilePath.GetSubSection("IDC_STATIC_PROPERTIES").GetOption("English", "Not Exists")); //It prints the required result







We want to use INI files stored in Stores. Please let us know how to use the same.

2 Replies

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi,


    To access the created Stores item, you can use the following syntax:



    Files.Test_ini

    // -- or --

    Files.FileNameByName("Test_ini")


    I couldn't check the script you posted due to the target INI file's structure. So, if the code I suggested won't help, please post here your INI file so that we could use it to check the scripts. If you don't want to share your file on the forum, you can send this file directly to our Support Team.


    Thanks.

  • Hi Irina Lukina.



    Thanks. It works fine with Files.FileNameByName("Test_ini")