Skip to content

Commit e4aef70

Browse files
authored
Merge pull request livecode#6283 from livecodeali/bugfix-19760
[[ Bug 19760 ]] Clarify forms of log command in LCB docs
2 parents d6fc4d6 + 8671eb3 commit e4aef70

2 files changed

Lines changed: 24 additions & 11 deletions

File tree

docs/lcb/notes/19760.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# LiveCode Builder Standard Library
2+
3+
# [19760] Clarify forms of log syntax in documentation

engine/src/engine.lcb

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ begin
473473
end syntax
474474

475475
/**
476-
Summary: Logs a string.
477-
String: The string to log.
476+
Summary: Logs a value.
477+
Value: The value to log.
478478
Arguments: A list of arguments.
479479

480480
Example:
@@ -487,23 +487,33 @@ Example:
487487

488488
log "Widget %@ has id %@" with tList
489489

490+
Example:
491+
variable tList as List
492+
put [1,2,3,4] into tList
493+
log tList
494+
490495
Description:
491-
The log command triggers a logChanged message with the accumulated log messages since the logChanged message was last handled.
496+
The log command triggers a logChanged message with the
497+
accumulated log messages since the logChanged message
498+
was last handled.
492499
This can be handled in LiveCode Script, for example:
493-
```
494-
on logChanged pLog
495-
write pLog to stdout
496-
end logChanged
497-
```
498500

501+
on logChanged pLog
502+
write pLog to stdout
503+
end logChanged
504+
505+
If using the 'with arguments' form, the <Value> must be a String.
506+
Each occurrence of %@ in the String is replaced by a string
507+
representation of subsequent values in the <Arguments> List.
508+
499509
Tags: Script Engine
500510
*/
501511

502512
syntax Log is statement
503-
"log" <Message: Expression> [ "with" <Arguments: Expression> ]
513+
"log" <Value: Expression> [ "with" <Arguments: Expression> ]
504514
begin
505-
MCEngineExecLog(Message)
506-
MCEngineExecLogWithValues(Message, Arguments)
515+
MCEngineExecLog(Value)
516+
MCEngineExecLogWithValues(Value, Arguments)
507517
end syntax
508518

509519
/**

0 commit comments

Comments
 (0)