Renamed ShellExecuteCode to ...File; added ShellExecuteCode to execute a fragment of code
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user