AI雑記

おもにAppInventorついての備忘録とかと書いていく予定です

コントロール配列的なものを作ってみた

make a listブロックにコンポーネントを適当に追加してみると、エラーになってしまいます。

Global variable definitions cannot reference components or other global variables. The Blocks Editor will accept this block, but the app will signal an error when it starts, and you cannot package it for the phone. To make the variable's initial value reference another variable or a component, define the variable with some arbitrary initial value, say 0, and set the correct initial value in the screen initialization event handler.

要約すると、
グローバル変数にはコンポーネントや他のグローバル変数は追加できません。そのような変数を作りたい場合は、とりあえず定義した変数に0をセットし、Screen Initializationイベントハンドラ内で改めて初期化します」といった感じでしょうか?

で、実際にやってみたのがこちら。

これでコンポーネントをまとめて扱うのが少し便利になるはず(^^)