Argument

This article is about the part of a block. For a conflict between Scratchers, see Flame War.
"Insert" redirects here. For the Data block with "Insert" in its name, see Insert () at () of () (block). For a tutorial about how to insert a character into a string, see Inserting a Character into a String.

An argument is any area in a block that accepts user input, or another block. It could be a Boolean Block or a value placed inside of a variable or block.

Arguments

Document.png Please expand this article or section. You can help by adding more information if you are an editor. More information might be found in a section of the talk page.

The following are types of arguments in Scratch:

Numeric Insert

A numeric insert is an insert for numbers.

String Insert

A string insert is an insert.

Drop-Down Menu

A drop-down menu.

A drop-down menu is a menu of options that appears in response to an action. Several blocks feature a drop-down menu, each of which can be accessed by clicking on an upside down triangle in the block. Sometimes, a drop-down menu will be so long that all options cannot be viewed. In these situations, the are hover buttons which can be used to scroll through the drop-down menu.

Boolean Insert

A Boolean insert is an insert for booleans.

Color Insert

A color insert is an insert for colors.

Scratch internals

Archive.png This article or section documents a feature not included in the current version of Scratch (2.0). It is only useful from a historical perspective.

Each argument has a Squeak code. These are all available in the "Scratch-Blocks" category in the System Browser.

Types

The following are the types of arguments with their Squeak code:

  • AttributeArgMorph — The first drop-down in the () of () Sensing block
  • BooleanArgMorph — To insert a Boolean Block
  • ChoiceArgMorph — A drop-down menu that does not allow reporter blocks to be dropped in
  • ChoiceOrExpressionArgMorph — A drop-down menu that allows reporter blocks to be dropped in
  • ColorArgMorph — A color insert
  • EventTitleMorph — A broadcast
  • ExpressionArgMorph — Either a number or string insert
  • ExpressionArgMorphWithMenu — Either a number or string insert that has a dropdown menu; differs from ChoiceOrExpressionArgMorph in the fact that it can have something typed in
  • SpriteArgMorph — A sprite drop-down menu

There are other categories in Scratch-Blocks, but those are for block types.

Calling (Scratch 1.4)

The Replace Item () of () With () block with its arguments and variables highlighted.

Argument names are case-sensitive, and start with a letter. In the Scratch System Browser, they are prefaced with a "$" in the list, and "%" when being called. For example, %S is different from %s.

Calling (Scratch 2.0)

The Replace Item () of () With () block with its arguments and variables highlighted.

Argument names are case-sensitive, and start with a letter. In the Scratch System Browser, they are prefaced with a "$" in the list, and "%" when being called. For example, %S is different from %s.

See Also

  • This page was last modified on 2 February 2017, at 18:20.