System platform 2023 R2: Action scripts, I want to load a list of strings from text file into combo box using the method as Combobox1.Loadlist(fileName), I get an error saying "could not find the file in C:\Program Files (x86)\wonderware.InTouch"

Action Scripts

Parents
  • The possible solutions: Either of them should work. But the option 2 is preferred.

    1. Copy the text file to C:\Program Files (x86)\wonderware\InTouch (or)
    2. Pass the full path of the file to Combobox1.LoadList().  (Preferred solution).
  • thank you Srinivan,

    I did place the file in that directory (C:\Program Files (x86)\wonderware\InTouch), without the file extension (txt) it still cannot find it, with the extension (Text.txt) I get no errors however the combo box is still empty. I can read the file and load the list using VB.Net in Visual studio from same directory, using Combobox1.Items.AddRange(File.ReadAllLines(C:\Program Files (x86)\wonderware\InTouch\Test"))

    I have also tried to include the whole path in Combobox1.Loadlist("C:\Program Files (x86)/Wonderware\InTouch/Text.txt"), I get no error but the combox is empty.

    Maybe there is format the file is supposed to have for the function Loadlist to be able to read the file.

Reply
  • thank you Srinivan,

    I did place the file in that directory (C:\Program Files (x86)\wonderware\InTouch), without the file extension (txt) it still cannot find it, with the extension (Text.txt) I get no errors however the combo box is still empty. I can read the file and load the list using VB.Net in Visual studio from same directory, using Combobox1.Items.AddRange(File.ReadAllLines(C:\Program Files (x86)\wonderware\InTouch\Test"))

    I have also tried to include the whole path in Combobox1.Loadlist("C:\Program Files (x86)/Wonderware\InTouch/Text.txt"), I get no error but the combox is empty.

    Maybe there is format the file is supposed to have for the function Loadlist to be able to read the file.

Children