Skip to content

Script Language Wierdness #111

Answered by brutella
BugRoger asked this question in Q&A
Jun 21, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The script language is not quite Golang is it? ;)

You're right, it's not quite like Golang but very similar.

[]uint8 // odd, isn't this supposed to be byte[] according to the docs?

byte is actually an uint8.
see https://golang.org/src/builtin/builtin.go?s=2701:2718#L78

[40] // where did the 41 go? first bit was eaten somewhere

The KNX protocol defines that scene numbers start at value 0. But for users they start at 1.
Scene 41 is actually the byte value 40. 😉

[40 1] // wierd. in the golang playground this throws: mismatched types []uint8 and int. Some autoboxing going on here

The scripts lets you append values to an array using the +-operator like this.

var array = [10]
println(array

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BugRoger
Comment options

Answer selected by brutella
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #110 on June 22, 2021 07:18.