User Tag List

Results 1 to 2 of 2

Thread: Lua: Retrieving function arguments

  1. #1
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua: Retrieving function arguments

    Have a little problem here.
    I wanted to make a basic Lua Console so I could learn the language easier. I used the code:
    Code:
    do
       print = function(...)
           DoCall("print",...)
         end
    end
    to redirect all print calls to my "print" function inside MMF2.

    My Test Console

    Doing so, I discovered that the Lua extension crashes whenever you try to recieve an argument from a function MMF2 that isn't a string or value.
    The following for example all crash MMF2 because they call Boolean values or such like:
    Code:
    print(nil)
    print(false)
    print(true)
    table = {}
    print(table)
    Is there any way to recieve these arguments? Or would I have to output any result in another way?
    Thanks for your help.

  2. #2
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua: Retrieving function arguments

    Concerning this, lua should not crash but output an error message. Lua+ is even worse in this aspect

    You can convert the result to int or string in lua, I believe.
    Like this: print(0+false)

Similar Threads

  1. Function Eggtimer problem // Power Function for MMF2 Android?
    By ogrgkyle in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th May 2013, 03:17 AM
  2. Passing arguments to External Application
    By madmac in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st April 2011, 09:08 PM
  3. Arguments dans une application
    By Matrice in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 11th January 2011, 01:28 AM
  4. How to enter arguments for pipe object?
    By cade in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 15th September 2009, 10:18 PM
  5. Passing arguments to another program
    By Joeyotrevor in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 3rd December 2008, 04:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •