mirror of
https://github.com/irmen/prog8.git
synced 2024-12-25 23:29:55 +00:00
docs: replaced old invalid c64scr names with txt
This commit is contained in:
parent
99759ae853
commit
92ee0aefee
@ -522,12 +522,12 @@ Use a ``when`` statement if you have a set of fixed choices that each should res
|
|||||||
action. It is possible to combine several choices to result in the same action::
|
action. It is possible to combine several choices to result in the same action::
|
||||||
|
|
||||||
when value {
|
when value {
|
||||||
4 -> c64scr.print("four")
|
4 -> txt.print("four")
|
||||||
5 -> c64scr.print("five")
|
5 -> txt.print("five")
|
||||||
10,20,30 -> {
|
10,20,30 -> {
|
||||||
c64scr.print("ten or twenty or thirty")
|
txt.print("ten or twenty or thirty")
|
||||||
}
|
}
|
||||||
else -> c64scr.print("don't know")
|
else -> txt.print("don't know")
|
||||||
}
|
}
|
||||||
|
|
||||||
The when-*value* can be any expression but the choice values have to evaluate to
|
The when-*value* can be any expression but the choice values have to evaluate to
|
||||||
|
@ -772,11 +772,11 @@ Choices can result in a single statement or a block of multiple statements in w
|
|||||||
case you have to use { } to enclose them::
|
case you have to use { } to enclose them::
|
||||||
|
|
||||||
when value {
|
when value {
|
||||||
4 -> c64scr.print("four")
|
4 -> txt.print("four")
|
||||||
5 -> c64scr.print("five")
|
5 -> txt.print("five")
|
||||||
10,20,30 -> {
|
10,20,30 -> {
|
||||||
c64scr.print("ten or twenty or thirty")
|
txt.print("ten or twenty or thirty")
|
||||||
}
|
}
|
||||||
else -> c64scr.print("don't know")
|
else -> txt.print("don't know")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,28 +5,46 @@
|
|||||||
main {
|
main {
|
||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
|
|
||||||
|
txt.print("hello")
|
||||||
|
txt.print("hello2")
|
||||||
|
txt.print("hello")
|
||||||
|
txt.print("hello2")
|
||||||
txt.nl()
|
txt.nl()
|
||||||
|
txt.print("1")
|
||||||
|
txt.print("1")
|
||||||
txt.nl()
|
txt.nl()
|
||||||
|
txt.print("12")
|
||||||
|
txt.print("12")
|
||||||
|
txt.nl()
|
||||||
|
txt.print("123")
|
||||||
|
txt.print("123")
|
||||||
txt.nl()
|
txt.nl()
|
||||||
|
|
||||||
|
derp.derp2()
|
||||||
|
txt.chrout('!')
|
||||||
|
|
||||||
txt.setcc2(0,0, 'a', $0f)
|
sys.wait(3*60)
|
||||||
txt.setcc2(1,0, 'a', $1f)
|
}
|
||||||
txt.setcc2(2,0, 'a', $2f)
|
}
|
||||||
txt.setcc2(3,0, 'a', $3f)
|
|
||||||
txt.setcc2(4,0, 'a', $4f)
|
|
||||||
txt.setcc2(5,0, 'a', $5f)
|
|
||||||
txt.setcc2(6,0, 'a', $6f)
|
|
||||||
txt.setcc2(7,0, 'a', $7f)
|
|
||||||
txt.setcc2(8,0, 'a', $8f)
|
|
||||||
txt.setcc2(9,0, 'a', $9f)
|
|
||||||
txt.setcc2(10,0, 'a', $af)
|
|
||||||
txt.setcc2(11,0, 'a', $bf)
|
|
||||||
txt.setcc2(12,0, 'a', $cf)
|
|
||||||
txt.setcc2(13,0, 'a', $df)
|
|
||||||
txt.setcc2(14,0, 'a', $ef)
|
|
||||||
txt.setcc2(15,0, 'a', $ff)
|
|
||||||
|
|
||||||
|
derp {
|
||||||
|
|
||||||
|
sub derp2 () {
|
||||||
|
txt.print("hello")
|
||||||
|
txt.print("hello2")
|
||||||
|
txt.print("hello")
|
||||||
|
txt.print("hello2")
|
||||||
|
txt.nl()
|
||||||
|
txt.print("1")
|
||||||
|
txt.print("1")
|
||||||
|
txt.nl()
|
||||||
|
txt.print("12")
|
||||||
|
txt.print("12")
|
||||||
|
txt.nl()
|
||||||
|
txt.print("123")
|
||||||
|
txt.print("123")
|
||||||
|
txt.nl()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user