Renamed ShellExecuteCode to ...File; added ShellExecuteCode to execute a fragment of code

This commit is contained in:
Paul Kulchenko
2012-01-28 10:52:35 -08:00
parent e4e5e82660
commit 16dcd084e1
2 changed files with 8 additions and 3 deletions

View File

@@ -238,7 +238,6 @@ local env = createenv()
local function executeShellCode(tx)
if tx == nil or tx == '' then return end
DisplayShellDirect('\n')
DisplayShellPrompt('')
local addedret = false
@@ -277,13 +276,18 @@ function ShellSupportRemote(client,uid)
client and "Remote console" or "Local console")
end
function ShellExecuteCode(wfilename)
function ShellExecuteFile(wfilename)
if (not wfilename) then return end
local cmd = 'dofile([['..wfilename:GetFullPath()..']])'
DisplayShellDirect(cmd)
executeShellCode(cmd)
end
function ShellExecuteCode(code)
DisplayShellDirect(code)
executeShellCode(code)
end
local function displayShellIntro()
DisplayShellDirect([[Welcome to the interactive Lua interpreter.
Enter Lua code and press Enter to run it. Use Shift-Enter for multiline code.
@@ -350,6 +354,7 @@ out:Connect(wx.wxEVT_KEY_DOWN,
out:ClearAll()
displayShellIntro()
else
DisplayShellDirect('\n')
executeShellCode(promptText)
end
currentHistory = getPromptLine() -- reset history