pxt-calliope/docs/reference/basic/show-string.md

42 lines
1.2 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# Show String
Show a number on the [LED screen](/device/screen). It will slide left if it is bigger than the screen.
2016-03-26 00:47:20 +01:00
```sig
basic.showString("Hello!")
```
### Parameters
* `text` is a [String](/reference/types/string). It can contain letters, numbers, and punctuation.
* `ms` is an optional [Number](/reference/types/number). It means the number of milliseconds before sliding the [String](/reference/types/string) left by one LED each time. Bigger intervals make the sliding slower.
2016-03-26 00:47:20 +01:00
### Examples:
To show the word **Hello**:
2016-03-26 00:47:20 +01:00
```blocks
basic.showString("Hello")
```
To show what is stored in a [String](/reference/types/string) variable:
2016-03-26 00:47:20 +01:00
```blocks
let s = "Hi"
basic.showString(s)
```
### Other show functions
* Use [show number](/reference/basic/show-number) to show a number on the [LED screen](/device/screen).
* Use [show animation](/reference/basic/show-animation) to show a group of pictures on the screen, one after another.
2016-03-26 00:47:20 +01:00
### Lessons
2016-04-18 17:33:09 +02:00
[answering machine](/lessons/answering-machine), [rock paper scissors](/lessons/rock-paper-scissors), [love meter](/lessons/love-meter)
2016-03-26 00:47:20 +01:00
### See also
2016-04-16 01:15:08 +02:00
[String](/reference/types/string), [show number](/reference/basic/show-number), [show animation](/reference/basic/show-animation)
2016-03-26 00:47:20 +01:00