みんなに優しく、解りやすくをモットーに開設しています。 以下のルールを守りみんなで助け合いましょう。
1.ファイルメーカーで解らない事があればここで質問して下さい。 何方でも、ご質問・ご回答お願いします。 (優しく回答しましょう)
You are not logged in.
Pages: 1
説明しづらかったので動画を撮ってみました
https://youtu.be/jRIq9EqIXWE
動画のように、ステップが飛んでほしくないところで飛んでしまいます。
スクリプトトリガはOnObjectEnterで設定しています。
スクリプトでIF文を使い4つの条件分岐をしているのですが、
例えば条件2に入った後、最初のステップに戻る場合があります。
(デバックモードで確認しました。)
Else if文で書き直してみましたが同じような挙動をする場合があり、変わりませんでした。
単純に「始めの処理→条件にあった時の処理→終わりの処理」としたいのですが、
どうしたら良いでしょうか?
ランダムにカードの色と文を変えるアプリで
オブジェクトタイプのフィールド(フィールド名&オブジェクト名:card1~4)で、
「入力値の自動化:計算式:$$card1」として、
条件付き書式で「値が”赤”に等しいとき:塗りつぶし」のように場合分けをして、
スクリプトトリガで押したときにスクリプトが動くようにしています。
フィールドClrは繰り返しフィールドで「赤、青、黄、緑」としています。
スクリプトは以下です
Set Variable [$cardRnd; Value:Int ( Random * 4)+1]
Set Variable [$colorRnd; Value:Int ( Random * 4)+1]
If [$cardRnd = 1]
Set Variable [$$cardColor1; Value:GetRepetition ( helloworld::Clr ; $colorRnd )]
Set Variable [$$crdTxt1; Value:GetRepetition ( helloworld::Clr ; $colorRnd )]
Insert Calculated Result [Selecthelloworld::Card1[]; $$Cardcolor1]
Refresh Object [Object Name: : "card1"]
End If
If [$cardRnd = 2]
Set Variable [$$cardColor2; Value:GetRepetition ( helloworld::Clr ; $colorRnd )]
Set Variable [$$crdTxt2; Value:GetRepetition ( helloworld::Clr ; $colorRnd )]
Insert Calculated Result [Selecthelloworld::Card2[]; $$Cardcolor2]
Refresh Object [Object Name: : "card2"]
End If
If [$cardRnd = 3]
Set Variable [$$cardColor3; Value:GetRepetition ( helloworld::Clr ; $colorRnd )]
Set Variable [$$crdTxt3; Value:GetRepetition ( helloworld::Clr ; $colorRnd )]
Insert Calculated Result [Selecthelloworld::Card3[]; $$Cardcolor3]
Refresh Object [Object Name: : "card3"]
End If
If [$cardRnd = 4]
Set Variable [$$cardColor4; Value:GetRepetition ( helloworld::Clr ; $colorRnd )]
Set Variable [$$crdTxt4; Value:GetRepetition ( helloworld::Clr ; $colorRnd )]
Insert Calculated Result [Selecthelloworld::Card4[]; $$Cardcolor4]
Refresh Object [Object Name: : "card4"]
End If
Commit Records/Requests []
Refresh Window []
Pages: 1
[ Generated in 0.032 seconds, 6 queries executed - Memory usage: 511.27 KiB (Peak: 516.48 KiB) ]