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

Commit bd9fc27

Browse files
committed
[[ Bug 20094 ]] Execute msg box if it compiles
This patch ensures that if the message box script compiles ok and we fail to find any improvements by autocompleting the script it is still executed.
1 parent 8f2dee9 commit bd9fc27

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
@@ -11512,7 +11512,11 @@ command ideExecuteScript pScript, pObject, pDebugMode, @rValidScript
1151211512
end if
1151311513

1151411514
if tValidScript is empty then
11515-
return tOriginalCompileError for error
11515+
if tOriginalCompileError is not empty then
11516+
return tOriginalCompileError for error
11517+
else
11518+
put pScript into tValidScript
11519+
end if
1151611520
end if
1151711521
unlock screen
1151811522

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)