m (Reverted edits by Jonathanpb (Talk) to last revision by Chrischb)
Line 1: Line 1:
 
{{Block
 
{{Block
|name = Join ()()
+
|name = Join () ()
|image = File:Join_()().png
+
|image = File:Join () ().gif
|imagewidth = 57px
+
|imagewidth = 105px
|category = [[Operators Blocks|Operators]]
+
|category = [[Operators Blocks|Operators Block]]
|type = [[Reporter Block|Reporter]]
+
|type = [[Reporter Block]]
 
}}
 
}}
The '''Join ()()''' [[Blocks|block]] is an [[Operators Blocks|Operators block]] and a [[Reporter Block|Reporter block]]. The block 'sticks' the two values together and reports the result - for example, if "hello" and "world" were put in the block, it would report "helloworld".
+
The '''Join ()()''' block puts two strings together, but doesn't necessarily combine them to make a new value. It is a [[Reporter Block|reporter block]] that can have other [[Reporter Block|reporter]]/[[Boolean Block|boolean]] blocks inside it.  
==Common uses==
 
If words, numbers, sentences - any two values - must be stuck together, this block easily does the job.
 
  
Some common uses for the '''Join ()()''' block:
+
==Common Uses==
*Sticking together words and variables to create a sentence
+
[[File:Hello (answer).gif|thumb|432px|An example script using the Join ()() Block]]
 +
This [[Block|block]] is commonly used to:
 +
*Use the value of a [[variable]] in a block of text
 +
*Use the value of the [[Answer (block)|answer block]] in a block of text
 +
*Joining any two values together in a [[list]] or block of text
 +
[[Category:Operators Blocks]]
  
[[File:Hello (answer).gif]]
+
==Offline Decimal Trick==
 +
Offline, numbers in variables and speech bubbles usually round to only two decimal places. In some projects, it is necessary to have more. Using the '''join ()()''' block is one way to get many more decimal places. Simply join the operations used to get the number to nothing. Example:
 +
 
 +
The original script:
  
*Place a [[variable]] in a message (eg. "You completed '''2''' loops")
 
*An easy method of making a positive number turn negative (placing "-" in the first input and the positive number in the second)
 
==Offline decimal trick==
 
Offline, numbers in variables and speech bubbles usually round to only two decimal places. In some [[Project|projects]], it is necessary to have more. Placing the calculation in one input of the '''Join ()()''' block and leaving the other input empty 'magically' reports the number with more decimal places.
 
*The original script:
 
 
[[File:No join.gif]]
 
[[File:No join.gif]]
*Script with more decimals:
+
 
 +
Script with more decimals:
 +
 
 
[[File:Join Trick.gif]]
 
[[File:Join Trick.gif]]
*To set the number of decimal places, use a script like this:
+
 
 +
To set the number of decimal places, use a script like this:
 
[[File: Set Decimal places.gif|550px]]
 
[[File: Set Decimal places.gif|550px]]
 +
 
{{Operators Blocks}}
 
{{Operators Blocks}}
 +
{{Scratch Blocks}}
 
[[Category:Operators Blocks]]
 
[[Category:Operators Blocks]]

Revision as of 05:39, 2 September 2010

Join () ()
File:Join () ().gif
Category Operators Block
Type Reporter Block

The Join ()() block puts two strings together, but doesn't necessarily combine them to make a new value. It is a reporter block that can have other reporter/boolean blocks inside it.

Common Uses

File:Hello (answer).gif
An example script using the Join ()() Block

This block is commonly used to:

  • Use the value of a variable in a block of text
  • Use the value of the answer block in a block of text
  • Joining any two values together in a list or block of text

Offline Decimal Trick

Offline, numbers in variables and speech bubbles usually round to only two decimal places. In some projects, it is necessary to have more. Using the join ()() block is one way to get many more decimal places. Simply join the operations used to get the number to nothing. Example:

The original script:

File:No join.gif

Script with more decimals:

File:Join Trick.gif

To set the number of decimal places, use a script like this: 550px

Cookies help us deliver our services. By using our services, you agree to our use of cookies.