batch fixing ](/microbit/ -> ](/ links
This commit is contained in:
@@ -15,7 +15,7 @@ Benefits of using libraries:
|
||||
|
||||
To add a library to a script:
|
||||
|
||||
1. Open a script in the [Touch Develop editor](/microbit/js/editor) and then click `script` (in the upper-right corner).
|
||||
1. Open a script in the [Touch Develop editor](/js/editor) and then click `script` (in the upper-right corner).
|
||||
|
||||
2. Click `+` **add new**.
|
||||
|
||||
@@ -23,15 +23,15 @@ To add a library to a script:
|
||||
|
||||
4. Choose the library you want to use or search for a library (such as `game`).
|
||||
|
||||
Once you've added a library to your script, you can use any of the library's non-private [functions](/microbit/js/function). Here's how:
|
||||
Once you've added a library to your script, you can use any of the library's non-private [functions](/js/function). Here's how:
|
||||
|
||||
* on the [Code Keyboard](/microbit/js/editor) click the button with the library's name (for example, `micro:bit` and `micro:bit game` are library buttons). The functions in the library have a button on the Code Keyboard.
|
||||
* on the [Code Keyboard](/js/editor) click the button with the library's name (for example, `micro:bit` and `micro:bit game` are library buttons). The functions in the library have a button on the Code Keyboard.
|
||||
|
||||
### Create a library
|
||||
|
||||
Creating and publishing a script as a library is easy. Here's how:
|
||||
|
||||
1. Open a script in the [Touch Develop editor](/microbit/js/editor), and then click `script`.
|
||||
1. Open a script in the [Touch Develop editor](/js/editor), and then click `script`.
|
||||
|
||||
2. Click the script name to open the script properties.
|
||||
|
||||
@@ -50,15 +50,15 @@ The following library items are not accessible by other scripts:
|
||||
* data (global variables)
|
||||
* functions marked as `private`
|
||||
|
||||
If you want to access global library variables from other scripts, you need to create [functions](/microbit/js/function) that pass values in and out of the library script.
|
||||
If you want to access global library variables from other scripts, you need to create [functions](/js/function) that pass values in and out of the library script.
|
||||
|
||||
### Library and function documentation
|
||||
|
||||
Be sure to document the purpose of your functions and libraries. Add a [comment](/microbit/js/comment) at the beginning of a library to describe the purpose of the library.
|
||||
Be sure to document the purpose of your functions and libraries. Add a [comment](/js/comment) at the beginning of a library to describe the purpose of the library.
|
||||
|
||||
Use [comments](/microbit/js/comment) at the beginning of your [functions](/microbit/js/function) to describe the function's purpose. Comment text shows in the help area of the Code Keyboard when you insert the function.
|
||||
Use [comments](/js/comment) at the beginning of your [functions](/js/function) to describe the function's purpose. Comment text shows in the help area of the Code Keyboard when you insert the function.
|
||||
|
||||
### See also
|
||||
|
||||
[functions](/microbit/js/function), [Touch Develop Documentation](/microbit/js/contents)
|
||||
[functions](/js/function), [Touch Develop Documentation](/js/contents)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user