/ Forums / Advansys Formativ / Creating Solutions with Formativ / Relativ path in Stringlist.LoadFromFile()

  • Creator
    Topic
  • #4269
    griesserag
    Participant

      Hi

      I tried to use the relativ path to my formativ application in the Stringlist.LoadFromFile() function, but it didn’t work. When I declare the full path it works.

      i.e.
      The application file *.vbf is located in C:App
      In the same folder is also a textfile, which I’d like to load.

      I use myStrList.Loadfromfile(“C:AppmyFile.txt”). This works, but when I use use myStrList.Loadfromfile(“myFile.txt”) it doesn’t work. How can I solve this problem? Is it possible to get the path of the currently running applet? So it would be possible to use this path.

      Thanks.

      regards

    • Author
      Replies
    • #7672
      griesserag
      Participant

        I found out how I can realise that. The following code returns the path of the currently running applet:

        appletPath = Utilities.CurrentAppletName
        appletName = Utilities.CurrentAppletShortName & “.vbf”
        appletPath = left(appletPath, InstrRev(appletPath, appletName, -1, 1) – 1)

        Regards

        #7673
        Support 2
        Moderator

          Thanks for the update!

          Regards,

          Advansys Support

        Viewing 2 replies - 1 through 2 (of 2 total)
        • You must be logged in to reply to this topic.