Skip to content, Skip to search

Changes

Introduction into Macro Programming

3 bytes removed, 21:52, 14 November 2019
m
Using variables
'''Note:''' a common pitfall is to include the name of a variable in a string. The following code demonstrates this:
('''BAD''' lines are commented out to discourage copying them. If you paste this code in the [[Script_Editor|script editor]], you can uncomment these lines to see the their errors)
<source lang="java">
run("Median...", "radius=" + specifiedRadius); // GOOD - will correctly pass the radius variable value
</source>
'''Note:''' when concatenating strings, whenspace whitespace will not automatically be added. So care must be taken, for example when spaces are ''desired''.
<source lang="java">
// We want to use the "Li white" threshold
Bureaucrat, emailconfirmed, incoming, administrator, uploaders
12,110
edits