Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit f685e7f

Browse files
authored
Merge pull request #1948 from montegoulding/bugfix-20094
[[ Bug 20094 ]] Execute msg box if it compiles
2 parents d60f2ce + bd9fc27 commit f685e7f

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

Toolset/libraries/revidelibrary.8.livecodescript

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11514,7 +11514,11 @@ command ideExecuteScript pScript, pObject, pDebugMode, @rValidScript
1151411514
end if
1151511515

1151611516
if tValidScript is empty then
11517-
return tOriginalCompileError for error
11517+
if tOriginalCompileError is not empty then
11518+
return tOriginalCompileError for error
11519+
else
11520+
put pScript into tValidScript
11521+
end if
1151811522
end if
1151911523
unlock screen
1152011524

notes/bugfix-20094.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix multi-line message box not executing if the first line is a comment

tests/messagebox/execution.livecodescript

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,28 @@ on TestReferenceControlOnActiveStack
319319
create stack
320320
set the defaultStack to the short name of it
321321

322-
local tToExecute
322+
local tToExecute, tValidScript
323323
put "put bar into field 1" into tToExecute
324324
ideExecuteScript tToExecute, tStack, false, tValidScript
325325

326326
TestAssert "intelligence object command two params result", the text of tField is "bar"
327327
TestAssert "intelligence object command two params executed", tValidScript is tToExecute
328-
end TestReferenceControlOnActiveStack
328+
end TestReferenceControlOnActiveStack
329+
330+
-- bug 20084
331+
on TestMutilineWithCommentOnFirstLine
332+
local tStack, tField
333+
create stack
334+
put it into tStack
335+
336+
set the defaultStack to the short name of tStack
337+
338+
create field
339+
put it into tField
340+
341+
local tToExecute, tValidScript
342+
put "-- foo" & return & "put bar into field 1" into tToExecute
343+
ideExecuteScript tToExecute, tStack, false, tValidScript
344+
345+
TestAssert "multiline script with comment on first line executes", the text of tField is "bar"
346+
end TestMutilineWithCommentOnFirstLine

0 commit comments

Comments
 (0)