Ticket #8024

ループコマンドについて
Date d'ouverture: 2006-02-13 16:39 Dernière mise à jour: 2007-07-27 17:14

Rapporteur:
(Anonyme)
Propriétaire:
État:
Atteints
Composant:
(Aucun)
Jalon:
(Aucun)
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
1
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

forやwhileは指定した条件を満たすまで繰り返しますが、
設定した条件以外でループ処理から抜けようとした場合、
変数にlastより大きい数値を入力するとlastの数値に
なるまで引き算でループを繰り返し、gotoを使用しても
ループを終了したわけではないので、10回程繰り返すと
"Stack overflow"になります。

ループ部分を"goto"で作成すれば良いのですが、任意の
場所でループを終了させる事は可能でしょうか?

;<変数に数値を入力した場合>
cnt = 1
for i 0 10
int2str msg1 cnt
int2str msg2 i
messagebox msg1 msg2
if cnt = 2 i = 15
cnt = cnt + 1
next


;<gotoを使用した場合>
cnt = 1
:roop
for i 0 10
int2str msg1 cnt
messagebox msg1 'cnt'
cnt = cnt + 1
goto roop
next

Ticket History (3/8 Histories)

2006-02-19 16:00 Updated by: (del#10776)
Commentaire
Logged In: YES
user_id=10776

将来、マクロコマンド break を追加したいと思います。

2006-02-19 16:00 Updated by: (del#10776)
Commentaire
Logged In: YES
user_id=10776

将来、マクロコマンド break を追加したいと思います。

2006-08-13 13:34 Updated by: (del#1144)
  • (Catégorie change on Tracker)
2007-07-20 17:52 Updated by: doda
  • Propriétaire Update from (Aucun) to doda
2007-07-23 21:36 Updated by: doda
  • Résolution Update from Aucun to Fixed
Commentaire
Logged In: YES
user_id=14322

for/whileループを終了させるマクロコマンド、breakを実装しまし
た。
問題がなければ、次リリース(4.53)に含まれます。
2007-07-24 23:58 Updated by: (del#1144)
Commentaire
Logged In: YES
user_id=1144

ありがとうございます。
二重ループでも問題ないことを確認しました。
2007-07-24 23:58 Updated by: (del#1144)
  • File 1984: break.ttl is attached
2007-07-27 17:14 Updated by: doda
  • Ticket Close date is changed to 2007-07-27 17:14
  • État Update from Ouvert to Atteints

Attachment File List

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion