How use a variable as argument for function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • DoveBirkoff
    Forum Member
    • Jul 2008
    • 36

    How use a variable as argument for function

    Taking as example:

    Code:
    local tResult = Dialog.FileBrowse(false, "Game Bug Reporter", _DesktopFolder, "Text Files (*.txt)|*.txt|", "B01", "txt", false, false)
    -- This will open a filebrowser where the default file name will be B01.

    How can I ser an argument using a variable?
    This is not working:

    Code:
    bugname = "B01";
    
    local tResult = Dialog.FileBrowse(false, "Game Bug Reporter", _DesktopFolder, "Text Files (*.txt)|*.txt|", bugname, "txt", false, false)

    I got an error, that 5th argument of this line must be an string.

    Thanks
    Last edited by DoveBirkoff; 07-31-2008, 05:05 PM.
  • Ulrich
    Indigo Rose Staff Member
    • Apr 2005
    • 5138

    #2
    Cannot confirm this. Your second code works correctly here.

    Ulrich

    Comment

    • DoveBirkoff
      Forum Member
      • Jul 2008
      • 36

      #3
      Actually the code is:

      Code:
      bugname = Input.GetText("Input6");
      
      local tResult = Dialog.FileBrowse(false, "Game Bug Reporter", _DesktopFolder, "Text Files (*.txt)|*.txt|", bugname, "txt", false, false)
      Also I tried:

      Code:
      bugname = Input.GetText("Input6");
      
      tResult = Dialog.FileBrowse(false, "Game Bug Reporter", _DesktopFolder, "Text Files (*.txt)|*.txt|", bugname, "txt", false, false)
      What is wrong with this way of set the 5th argument?

      Thanks buddies

      EDIT : Actually is fixed. Could be deleted this post?
      Last edited by DoveBirkoff; 07-31-2008, 06:09 PM.

      Comment

      Working...
      X