locked
Little problem with FCInstances RRS feed

  • Question

  • Hello guys!

    I have a little problem with my installer program (again).

    I added a "Show Readme" function, but it won't work right.

    Here is my program:  BGS154

    Everytime I click on the button, will the "Select Language" window shown. After I closed it, crashs the main program too.

    Please help me.


    Ich bin Neu

    Tuesday, September 18, 2012 4:29 PM

Answers

  • This problem isn't topically.

    Ich bin Neu

    • Marked as answer by Timo Sö Thursday, September 20, 2012 4:27 PM
    Thursday, September 20, 2012 4:27 PM

All replies

  • I recommend you don't use FCInstances - it is a bit complicated and there are no simple fixes to 'just make it work' - If you want to use FCInstances, you will have to go back to the simple previous examples and play and test with them to understand how it works.

    Copying bits of code out of sequence will not work.

    You don't need to set lang here:

          ElseIf (buttonData[i]["En"] = "Show Readme") Then
            lang = "EN"
            ReadmeEnSub()
          ElseIf (buttonData[i]["De"] = "Zeige Readme") Then
            lang = "De"
            ReadmeDeSub()

    and clearly:

    buttonData[i]["En"] = "Show Readme"

    is exactly the same as (if one is true so is the other) and vice-versa:

    buttonData[i]["De"] = "Zeige Readme"

    It is already set to En or you wouldn't be here and coding to reset it to a value it already is is just confusing.

    A little working out what is going on here:

    You should use:

            If (lang = "En") Then
              ReadmeEnSub()
            ElseIf (lang = "De") Then
              ReadmeDeSub()
            EndIf
    
    When you make a change you have to think it through and test before moving on.  The above code would never have worked, before started adding FCInstances and it then it has multiple errors.

    I recommend just showing the message in the main window.

    Tuesday, September 18, 2012 6:05 PM
  • Hm ok. Thanks for this.

    Now, is there an order to open a .txt file insteat of a new window?

    I can't find this order. That was my first idea.


    Ich bin Neu

    Tuesday, September 18, 2012 6:27 PM
  • The File command, you already have

    ReadmeDe = File.ReadContents(Program.Directory + "\README_DE.txt")
    And this should put the contents of the file into the variable ReadmeDe in this case.

    Tuesday, September 18, 2012 6:51 PM
  • Sure, but I don't want to store this file in a variable.

    I want, that the program open this README_DE.txt . As a seperate window. Like if you doubleclick on it.


    Ich bin Neu

    Wednesday, September 19, 2012 2:22 PM
  • This problem isn't topically.

    Ich bin Neu

    • Marked as answer by Timo Sö Thursday, September 20, 2012 4:27 PM
    Thursday, September 20, 2012 4:27 PM