Jump to content
Sign in to follow this  
jaberwacky

MouseHoverCallTips [09/25/2014]

Recommended Posts

Mmm. Seems like your assuming user functions are highlighted by default. However this might not be the case as its a separate feature. CQ not linked to the API part.

(guessing AdmiralAlkex might have no highlight active on his user functions.)

function MouseHoverCallTips:OnDwellStart(position, word)
    -- ...
    elseif (style == 14 or style == 15) then -- user defined functions and com methods
        directory = props["SciteDefaultHome"] .. "apiau3.user.calltips.api"
    -- ...
Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

I don't see what you mean. Could you elaborate?

like _GUICtrlListView_Create().

Mmm. Seems like your assuming user functions are highlighted by default. However this might not be the case as its a separate feature. CQ not linked to the API part.

(guessing AdmiralAlkex might have no highlight active on his user functions.)

function MouseHoverCallTips:OnDwellStart(position, word)
    -- ...
    elseif (style == 14 or style == 15) then -- user defined functions and com methods
        directory = props["SciteDefaultHome"] .. "\\api\\au3.user.calltips.api"
    -- ...
I don't understand.

Share this post


Link to post
Share on other sites

like _GUICtrlListView_Create().

...

I don't understand.

Aha. I was locked on local home made user UDF functions. (CQ: overlooking/ignoring the AutoIt-User-UDF's part.)

---

Now handles call tips for user defined functions and for com methods -- assuming that you have them defined.

Roger. Did not sink in at first. Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

This is super nice.

You think you could add tip for every other functions? For tip to show the first line of the definition.

For example if I have function defined as:

Func ABC(ByRef vVar, sSomething = "DEF", iSomethingElse = 456)
     ;...
EndFunc
...displayed tip would be
ABC(ByRef vVar, sSomething = "DEF", iSomethingElse = 456)

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Thanks!

Ok, so you mean to create call tips from functions which are not defined in an api file? I'll definitely look into that.

Edit: I may be able to modify AutoItGotoDefinition.lua to do this. No, that's going above and beyond what is needed.

Edited by LaCastiglione

Share this post


Link to post
Share on other sites

Tsk tsk. Hard coded paths and not resilient if said paths are missing.

Here's the fixed code. Changes are:

  • get_function_calltip() now checks if the file actually opened. If it doesn't it returns an empty string.
  • OnDwellStart() re-written and simplified. It now uses the api.$(au3) property which contains a full list of all API files. This removes the hard-coded files (Which were not present on my system). It iterates each API found until a match is located (or not). The property api.$(au3) should be standard on all installations.
  • I also renamed onstartUp() to onstartup() since Lua is case-sensitive. Your onstartUp() was never called. However, for reasons I don't know calling initialize_mouse_dwell() still doesn't work from onstartup(). It only seems to work if called from OnSwitchFile(). I suggest removing onstartup() since it isn't necessary.
MouseHoverCallTips = EventClass:new(Common)

--------------------------------------------------------------------------------
-- OnStartUp
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:OnStartup()
    self:initialize_mouse_dwell()
    return false
end

--------------------------------------------------------------------------------
-- OnSwitchFile
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:OnSwitchFile(path)
    self:initialize_mouse_dwell()
    return false
end

--------------------------------------------------------------------------------
-- initialize_mouse_dwell
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:initialize_mouse_dwell()
    --if (self:IsAu3File(path)) then
        local mousehover_calltips_dwelltime = tonumber(props["mousehover.calltips.dwelltime"])
        if (mousehover_calltips_dwelltime == nil) then mousehover_calltips_dwelltime = 700 end -- default
        scite.SendEditor(SCI_SETMOUSEDWELLTIME, mousehover_calltips_dwelltime)
    --end

    return true
end

--------------------------------------------------------------------------------
-- IsAu3File
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:IsAu3File(path)
    if (string.lower(string.sub(path, -4)) == string.lower(string.sub(props["au3"], -4))) then
        return true
    end

    return false
end

--------------------------------------------------------------------------------
-- find_instance
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:find_instance(source, pattern)
    local function find_first_instance(source, pattern, acc)
        if (source == '') then return 0 end

        if (pattern == '') then return 0 end

        if (acc == string.len(source)) then return 0 end

        if (string.sub(source, acc, acc) == pattern) then
            return acc
        else
            acc = acc + 1
            return find_first_instance(source, pattern, acc)
        end
    end

    return find_first_instance(source, pattern, 1)
end

--------------------------------------------------------------------------------
-- get_func_def
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:get_func_def(line, word, style)
    local var = string.gsub(line, " (", '(', 1)

    local position = self:find_instance(var, '(')

    if (position ~= 0) then
        local func_name = string.sub(var, 1, position - 1)

        if (style == 14) then func_name = string.gsub(func_name, "_AutoItObject_", '') end

        func_name = string.lower(func_name)

        word = string.lower(word)

        if (func_name == word) then return string.gsub(line, "%)(.)", "%)n%1") end -- changed: was adding a trailing empty line in some cases.
    end

    return nil
end

--------------------------------------------------------------------------------
-- get_function_calltip
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:get_function_calltip(directory, style, word)
    local file = io.open(directory, 'r')
    if file == nil then return "" end
    local function_calltip = ''

    for line in file:lines() do
        -- filter out constants
        if (style == 4) then
            local string_end = string.sub(line, -2)

            for i = 1, 4 do
                if (string_end == '?' .. i) then break end
            end
        end

        function_calltip = self:get_func_def(line, word, style)

        if (function_calltip ~= nil) then break end
    end

    file:close()

    return function_calltip
end

--------------------------------------------------------------------------------
-- OnDwellStart
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:OnDwellStart(position, word)
    if (word == "") then
        if (scite.SendEditor(SCI_CALLTIPACTIVE)) then scite.SendEditor(SCI_CALLTIPCANCEL) end
        return true
    end

    local style = scite.SendEditor(SCI_GETSTYLEAT, position)

    if (style == 4 or style == 14 or style == 15) then
        local directories = props["api.$(au3)"]

        if (directories ~= nil) then
            for directory in directories:gmatch("([^;rn]+)") do
                local function_calltip = self:get_function_calltip(directory, style, word)
                if (function_calltip ~= nil) then scite.SendEditor(SCI_CALLTIPSHOW, position, function_calltip) end
            end
        end
    end
    return true
end
Edited by Valik

Share this post


Link to post
Share on other sites

I concur. It displays an empty calltip though it does get the calltip from the api though.

Ok, changing this line in get_function_calltip from '' to nil works: local function_calltip = nil

Share this post


Link to post
Share on other sites

Oops, that was a last second untested change and it exposed a second problem. The first problem is that I returned "" from get_function_calltip() instead of nil but then tested for nil. The second problem (and why this happened) was the iterative loop never terminated on a successful match. So it would find the right match, show it, then it would search the next file, receive an empty string and display that and so forth.

Here is a fixed version. I also added in debugging code. It's off by default but can be quickly toggled to provide diagnostics in the future.

MouseHoverCallTips = EventClass:new(Common)

-- If you are experiencing problems with this script then set the following
-- variable to true to enable diagnostic messages.
MouseHoverCallTips.Debug = false

--------------------------------------------------------------------------------
-- OnSwitchFile
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:OnSwitchFile(path)
    self:initialize_mouse_dwell()
    return false
end

--------------------------------------------------------------------------------
-- initialize_mouse_dwell
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:initialize_mouse_dwell()
    --if (self:IsAu3File(path)) then
        local mousehover_calltips_dwelltime = tonumber(props["mousehover.calltips.dwelltime"])
        if (mousehover_calltips_dwelltime == nil) then mousehover_calltips_dwelltime = 700 end -- default
        scite.SendEditor(SCI_SETMOUSEDWELLTIME, mousehover_calltips_dwelltime)
    --end

    return true
end

--------------------------------------------------------------------------------
-- IsAu3File
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:IsAu3File(path)
    if (string.lower(string.sub(path, -4)) == string.lower(string.sub(props["au3"], -4))) then
        return true
    end

    return false
end

--------------------------------------------------------------------------------
-- find_instance
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:find_instance(source, pattern)
    local function find_first_instance(source, pattern, acc)
        if (source == '') then return 0 end

        if (pattern == '') then return 0 end

        if (acc == string.len(source)) then return 0 end

        if (string.sub(source, acc, acc) == pattern) then
            return acc
        else
            acc = acc + 1
            return find_first_instance(source, pattern, acc)
        end
    end

    return find_first_instance(source, pattern, 1)
end

--------------------------------------------------------------------------------
-- get_func_def
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:get_func_def(line, word, style)
    local var = string.gsub(line, " (", '(', 1)

    local position = self:find_instance(var, '(')

    if (position ~= 0) then
        local func_name = string.sub(var, 1, position - 1)

        if (style == 14) then func_name = string.gsub(func_name, "_AutoItObject_", '') end

        func_name = string.lower(func_name)

        word = string.lower(word)

        if (func_name == word) then return string.gsub(line, "%)(.)", "%)n%1") end -- changed: was adding a trailing empty line in some cases.
    end

    return nil
end

--------------------------------------------------------------------------------
-- get_function_calltip
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:get_function_calltip(directory, style, word)
    local file = io.open(directory, 'r')
    if file == nil then return nil end
    local function_calltip = nil

    for line in file:lines() do
        -- filter out constants
        if (style == 4) then
            local string_end = string.sub(line, -2)

            for i = 1, 4 do
                if (string_end == '?' .. i) then break end
            end
        end

        function_calltip = self:get_func_def(line, word, style)

        if (function_calltip ~= nil) then break end
    end

    file:close()

    return function_calltip
end

--------------------------------------------------------------------------------
-- OnDwellStart
--
--------------------------------------------------------------------------------
function MouseHoverCallTips:OnDwellStart(position, word)
    if (word == "") then
        if (scite.SendEditor(SCI_CALLTIPACTIVE)) then scite.SendEditor(SCI_CALLTIPCANCEL) end
        return true
    end

    local style = scite.SendEditor(SCI_GETSTYLEAT, position)

    if (style == 4 or style == 14 or style == 15) then
        local directories = props["api.$(au3)"]

        if (directories ~= nil) then
            self:DebugPrint("API files: " .. directories)
            for directory in directories:gmatch("([^;rn]+)") do
                self:DebugPrint("Searching API file: " .. directory)
                local function_calltip = self:get_function_calltip(directory, style, word)
                if (function_calltip ~= nil) then
                    self:DebugPrint("Found calltip in API file: " .. directory)
                    scite.SendEditor(SCI_CALLTIPSHOW, position, function_calltip)
                    return true
                end
            end
        else
            self:DebugPrint("The api.$(au3) is missing or empty.")
        end
    else
        self:DebugPrint("Unsupported style detected.")
    end
    return true
end

Edit: Oops, it was the line mentioned above. Returning "" when the file didn't open was wrong, too, though.

Edited by Valik

Share this post


Link to post
Share on other sites

Now if someone would implement trancexx suggestion this would be really awesome.

Ohhh yeah, kinda forgot about that. Thanks.

Edit: Aren't a list of functions kept somewhere in a lua table?

Edited by LaCastiglione

Share this post


Link to post
Share on other sites

If you are referring to showing calltips for all functions then don't bother. I already have code to mostly do that. It's unfinished and not linked to this feature, obviously. I've had it for years and at this point I don't even remember what's not finished about it. I should probably just publish it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By BugFix
      The block comment (internal: box comment) in SciTE cannot be toggled.
      I have now created a script that helps. It works with any file type for which the corresponding entries in the properties are created.For toggeling its required to detect, what the user want to do.
      Rules for detection:     - selection starts in an empty line (line break only)         following line begins with comment.box.start ==> action: uncomment         otherwise                                    ==> action: comment     - selection starts in line with text         line begins with comment.box.start           ==> action: uncomment         otherwise                                    ==> action: comment     - selection ends in an empty line AND       the line before begins with comment.box.end    ==> action: both lines are part of comment block, will deleted     - selection ends in line with comment.box.end    ==> action: line will deleted     - At least two lines must be selected, otherwise an error message is output to the console. This means that in nested block comments there is at least one more line between two comment.box.start markers.
      It is recommended to write all block comment settings into "SciTEUser.properties". The setting "comment.box.end.au3" from "SciTEGlobal.properties" is incorrect and must be corrected.
      comment.box.start.au3=#cs #~ If TAB should used as box.middle, define an alternation (e.g. "@Tab"),  #~ "\t" will not recognised as tab if passed as propertie. comment.box.tab.alternation= #~ If you want characters or tab in each line of comment block, define it here. #~ To use TAB, set the alternation variable here: $(comment.box.tab.alternation) comment.box.middle.au3= comment.box.end.au3=#ce Connection to SciTE
      Search a free command number. Use a Hotkey of your choice.
      If you have declared an option for user lua scripts (e.g.: "Lua.User.Scripts.Path=C:\code\lua"), copy the script to this folder.
      Otherwise copy it to a folder of your choice and change the path in the command: "dofile". But backslashes in the path must be masked. ("\\").
      If your path has spaces don't forgot to encapsulate in string delimiters.
      # 24 Toggle Block Comment command.name.24.*=Toggle Block Comment command.24.*=dofile $(Lua.User.Scripts.Path)/BlockComment.lua command.mode.24.*=subsystem:lua,savebefore:no command.shortcut.24.*=Ctrl+Alt+F10  
      Here the lua script:
      -- TIME_STAMP 2020-10-04 18:56:11 v 0.5 --[[ Toggle Block Comments ©BugFix ( autoit[at]bug-fix.info ) For toggeling its required to detect, what the user want to do. Rules for detection: - selection starts in an empty line (line break only) following line begins with comment.box.start ==> action: uncomment otherwise ==> action: comment - selection starts in line with text line begins with comment.box.start ==> action: uncomment otherwise ==> action: comment - selection ends in an empty line AND the line before begins with comment.box.end ==> action: both lines are part of comment block, will deleted - selection ends in line with comment.box.end ==> action: line will deleted - At least two lines must be selected, otherwise an error message is output to the console. Properties: It is recommended to write all block comment settings into SciTEUser.properties. The setting "comment.box.end.au3" from "SciTEGlobal.properties" is incorrect and must be corrected. comment.box.start.au3=#cs #~ If TAB should used as box.middle, define an alternation (e.g. "@Tab"), #~ "\t" will not recognised as tab if passed as propertie. comment.box.tab.alternation= #~ If you want characters or tab in each line of comment block, define it here. #~ To use TAB, set the alternation variable here: $(comment.box.tab.alternation) comment.box.middle.au3= comment.box.end.au3=#ce ]] local BlockComment = { -- variables ext, -- file extension boxStart, -- property: comment.box.start boxMiddle, -- property: comment.box.middle boxEnd, -- property: comment.box.end bMiddle, -- bool: boxMiddle is defined selStart, -- selection start position selEnd, -- selection end position lineStart, -- selection start line number lineEnd, -- selection end line number newText, -- the text that replaces the selection Init = function(self) self.ext = props["FileExt"] self.boxStart = props["comment.box.start."..self.ext] self.boxMiddle = props["comment.box.middle."..self.ext] local tabAlternation = props["comment.box.tab.alternation"] if tabAlternation ~= "" and self.boxMiddle == tabAlternation then self.boxMiddle = "\t" end self.boxEnd = props["comment.box.end."..self.ext] self.bMiddle = not (self.boxMiddle == "") self.selStart = editor.SelectionStart self.selEnd = editor.SelectionEnd self.lineStart = editor:LineFromPosition(self.selStart) self.lineEnd = editor:LineFromPosition(self.selEnd) self.newText = "" end, -- create the line w/wo middle markers NewLine = function(self, _num, _uncmt) local line = editor:GetLine(_num) if _uncmt then -- if second last line has box.end AND last line is empty OR if (_num == self.lineEnd -1 and self:LineIsEnd(_num) and self:LineIsEmpty(_num +1)) or -- if is the last line AND its empty --> stop proceeding (_num == self.lineEnd and self:LineIsEmpty(_num)) then return "" else -- if box.middle exists --> remove it if self.bMiddle then line = line:sub(self.boxMiddle:len()+1) end end else -- add box.middle if exists line = self.boxMiddle..line end return line end, -- checks if line is empty (has only a line break) LineIsEmpty = function(self, _lineNum) return (editor:GetLine(_lineNum) == "\r\n") end, -- checks if line has box.start LineIsStart = function(self, _lineNum) local line = editor:GetLine(_lineNum) return ( line:sub(1, self.boxStart:len()):lower() == self.boxStart:lower() ) end, -- checks if line has box.end LineIsEnd = function(self, _lineNum) local line = editor:GetLine(_lineNum) return ( line:sub(1, self.boxEnd:len()):lower() == self.boxEnd:lower() ) end, -- returns "false" if none error ErrorCheck = function(self) if self.selStart == self.selEnd then print("! NONE SELECTION.") return true elseif self.boxStart == "" or self.boxEnd == "" then print("! ERROR - The comment.box properties for *."..self.ext.." files are missing or incomplete.") return true elseif self.lineStart == self.lineEnd then print("! SINGLE LINE SELECTION. USE LINE COMMENT INSTEAD.") return true else return false end end, -- creates the text to toggle and replace the selection with it Toggle = function(self) self:Init() if self:ErrorCheck() then return end local uncomment = false local skip = 0 -- proceed with first line -- if start position is in empty line AND next line has box.start --> uncomment the block if self:LineIsEmpty(self.lineStart) and self:LineIsStart(self.lineStart +1) then uncomment = true skip = 1 -- the following line will ignored now -- if line from start position has box.start --> uncomment the block elseif self:LineIsStart(self.lineStart) then uncomment = true -- in other cases comment the block else -- insert box.start before the first line; if box.middle exists --> insert it too self.newText = self.boxStart.."\n"..self.boxMiddle..editor:GetLine(self.lineStart) end -- proceed with middle lines -- if box.middle is defined set/replace it in line local n = self.lineStart + 1 + skip local line while n < self.lineEnd do self.newText = self.newText..self:NewLine(n, uncomment) n = n + 1 end -- proceed with last line line = editor:GetLine(self.lineEnd) if not uncomment then self.newText = self.newText..self.boxMiddle..line..self.boxEnd else -- if uncomment the last line will ignored, but the trailing "\r\n" must deleted self.newText = self.newText:sub(1, -3) end -- replace the selection with the new toggled text editor:ReplaceSel(self.newText) end } BlockComment:Toggle() As far as I know, it is not possible to overwrite SciTE internal hotkeys. In this case "Ctrl+Shift+B" for IDM_BLOCK_COMMENT. Therefore I used the connection shown here.
      But if overwriting is possible, I would be interested in this solution.
      BlockComment.lua
    • By Bhooshan
      I need to mute an ongoing call on Microsoft teams without activating the window. Teams allows us to mute using shortcut key Ctrl+Shift+m but only when the window is active.
      # Used set option as ongoing call can be with any person which leads to change in Title Name.
      AutoItSetOption ( "WinTitleMatchMode", 2 ) 
      # I am not clear with the control ID which will be good to use here and also the key combination of ^M       
      ControlSend ( "Microsoft Teams", "", "[CLASS:Intermediate D3D Window; INSTANCE:1]", "{ctrl down}")
       
      Can anyone help...!!! 
       

    • By Sayed
      Hi there, 
      I'm new in AutoIt forms and using AutoIt to automate desktop application (able to automate the application normally but facing issue when I've to re-run the application twice within the same script...so need help in this please)
      here is the steps then followed by the issue in a brief : 
      1- run application . 
      2- do some actions (click menus,activate windows,set texts..)
      3- close the application. 
      4- run the application again & access the same controls.
      5- open the same windows again (like step 2)
      6- perform some validations (by getting texts from some text boxes)
      7- close the application again (and repeat 1-7 for 15 times in average )
      The issue 
      * all controls are accessible in the first run and actions done successfully on controls (for steps 1-3) BUT from the second run of the application from step-4 it's able to set focus only the main application window.
      Note: only unique properties used to while mapping the controls. 
      Error that appear in the console :
      UIAWrappers.au3" (1673) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: $x = Int($t[1] + ($t[3] / 2)) $x = Int($t[1] + (^ ERROR  
      Simple spy code  of one of the controls that has this strange issue(menubar&view menu Item): 
      ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=XXX;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app") ;main app form xxx _UIA_setVar("oP2","Title:=menuStrip1;controltype:=UIA_MenuBarControlTypeId;class:=WindowsForms10.Window.8.app") ;menuStrip1 ;~ $oUIElement=_UIA_getObjectByFindAll("View.mainwindow", "title:=View;ControlType:=UIA_MenuItemControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=View;controltype:=UIA_MenuItemControlTypeId;class:=") ;ControlType:=UIA_MenuItemControlTypeId;classname:=") ;~ Actions split away from logical/technical definition above can come from configfiles ;~_UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") ;~_UIA_Action("oP2","highlight") _UIA_Action("oP2","setfocus") _UIA_action("oUIElement","highlight") ;~_UIA_action("oUIElement","click")  
       
    • By Fenzik
      Hello All!
      i suggest to set default encoding in Scite4 for Autoit 3 to UTF 8 with Bom encoding, format recommended also in Autoit Help.
      In last editor version, when i open new script, for example Czech characters (č, ř, ž) aren't correct.
      So when i change Encoding to UTF 8 with Bom from Default Code page property state, everithing seems to be OK.
      Thank you and sorry for potentialy duplicated content.
      Fenzik
    • By matwachich
      AutoIt3 Lua Wrapper
      This is an AutoIt3 wrapper for the Lua scripting language. Consider it beta software, but since I will be using it in commercial product, expect it to evolve.
      It has been developped with Lua 5.3.5. Updates will come for new Lua version.
      Everything works just fine, except one (big) limitation: Anything that throws a Lua error (using C setjmp/longjmp functionality) will crash your AutoIt program. That means that it is impossible to use throw errors from an AutoIt function called by Lua (luaL_check*, lua_error...).
      It is hosted in Github: https://github.com/matwachich/au3lua
      Simple example
      #include <lua.au3> #include <lua_dlls.au3> ; Initialize library _lua_Startup(_lua_ExtractDll()) OnAutoItExitRegister(_lua_Shutdown) ; create new execution state $pState = _luaL_newState() _luaopen_base($pState) ; needed for the lua's print function $iRet = _luaL_doString($pState, 'print("Hello, world!")') If $iRet <> $LUA_OK Then ; read the error description on top of the stack ConsoleWrite("!> Error: " & _lua_toString($pState, -1) & @CRLF) Exit EndIf ; close the state to free memory (you MUST call this function, this is not AutoIt's automatic memory management, it's a C library) _lua_close($pState)
×
×
  • Create New...