Query about BREAK statement in Appinventor - Google Groups
文章推薦指數: 80 %
to MIT App Inventor Forum. How to break out of current while loop in AI2? Please help! Tim Carter's profile photo ... GroupsMITAppInventorForumConversationsLabelsAboutQueryaboutBREAKstatementinAppinventor925viewschromegeneral-questions-about-app-inventor-programminghome-networkmit-appinventor-2phonetablet-with-the-wifiwindows-7SkiptofirstunreadmessageMayankRathoreunread,Jul21,2017,3:05:37AM7/21/17ReplytoauthorSignintoreplytoauthorForwardSignintoforwardDeleteYoudonothavepermissiontodeletemessagesinthisgroupLinkReportmessageasabuseSignintoreportmessageasabuseShoworiginalmessageEitheremailaddressesareanonymousforthisgrouporyouneedtheviewmemberemailaddressespermissiontoviewtheoriginalmessagetoMITAppInventorForumHowtobreakoutofcurrentwhileloopin AI2?Pleasehelp!TimCarterunread,Jul21,2017,4:30:42AM7/21/17ReplytoauthorSignintoreplytoauthorForwardSignintoforwardDeleteYoudonothavepermissiontodeletemessagesinthisgroupLinkReportmessageasabuseSignintoreportmessageasabuseShoworiginalmessageEitheremailaddressesareanonymousforthisgrouporyouneedtheviewmemberemailaddressespermissiontoviewtheoriginalmessagetomitappinv...@googlegroups.comJustlikeyouwouldinanycodingsituation,setanif/thenclausewheretheloopmeetsacertainconditionseehere:https://groups.google.com/forum/#!searchin/mitappinventortest/break%7Csort:relevance/mitappinventortest/5Oq5TQFjts8/Kw5Kio7ayO8JSteveJGunread,Jul21,2017,8:44:23PM7/21/17ReplytoauthorSignintoreplytoauthorForwardSignintoforwardDeleteYoudonothavepermissiontodeletemessagesinthisgroupLinkReportmessageasabuseSignintoreportmessageasabuseShoworiginalmessageEitheremailaddressesareanonymousforthisgrouporyouneedtheviewmemberemailaddressespermissiontoviewtheoriginalmessagetoMITAppInventorForumYou cannotuseaButton.Clickorothermethodtobreakoutofaloop. Tointerrupttheloop(terminatingtheloopingbeforeitselfterminates)mustbedoneprogrammably,asAIdoesn'thaveabuiltinloopbreak. SeeTim'spost andhere https://code.google.com/archive/p/app-inventor-for-android/issues/474. Andendlessloopwillresultinaruntimeerror. ThemodelofeventprocessinginAppInventor by Lyn Dependingonhowyouareiterating,,insteadofasimpleloopyoucouldtryusingaClockassuggestedbyTaifun The'Dosomething'example . Youdidnotprovideanexampleofthe'looping'activity,sothatisaguess.Issue474(toprovideaBreakfunction)hasbeenonMIT's'todo'listsincelate2010...almostsevenyears. ThisisprobablyinsolvablebecauseAIexecutesasynchronously.Arunawayactivitywithinaloopwillcrashyourapp. Whattodo? Certainlyavoidlongloops(andperhapsloopsingeneral).Neverusealoopwithoutawaytoescape.Regards,SteveTaifununread,Jul21,2017,9:30:54PM7/21/17ReplytoauthorSignintoreplytoauthorForwardSignintoforwardDeleteYoudonothavepermissiontodeletemessagesinthisgroupLinkReportmessageasabuseSignintoreportmessageasabuseShoworiginalmessageEitheremailaddressesareanonymousforthisgrouporyouneedtheviewmemberemailaddressespermissiontoviewtheoriginalmessagetoMITAppInventorForum@SteveJG:Scottfoundasolution,seethelinkTimposted...TaifunSteveJGunread,Jul21,2017,9:46:55PM7/21/17ReplytoauthorSignintoreplytoauthorForwardSignintoforwardDeleteYoudonothavepermissiontodeletemessagesinthisgroupLinkReportmessageasabuseSignintoreportmessageasabuseShoworiginalmessageEitheremailaddressesareanonymousforthisgrouporyouneedtheviewmemberemailaddressespermissiontoviewtheoriginalmessagetoMITAppInventorForum@ThanksTaifun,. Scott'sexamples workto'terminatealoopearly'iftheloopis processingaList. Themethodswouldnotterminate Mathactivity. But,goodtoknow.Cansomethingsimilarbedonewith toterminatebeforethecounterreaches1000usingperhapsabuttonclick? TheonlysolutionIcanfindotherthanprovidinganifstatementwithintheloop..sayifcounter=200thencounter=1001 whichisasoftware'termination' istousesomethingoncesuggestedbyABGusingaClock andthat'workssometimes".--SteveAbrahamGetzlerunread,Jul21,2017,9:57:03PM7/21/17ReplytoauthorSignintoreplytoauthorForwardSignintoforwardDeleteYoudonothavepermissiontodeletemessagesinthisgroupLinkReportmessageasabuseSignintoreportmessageasabuseShoworiginalmessageEitheremailaddressesareanonymousforthisgrouporyouneedtheviewmemberemailaddressespermissiontoviewtheoriginalmessagetoMITAppInventorForumThisisanexampleofforcedbreaksinsievebasedprimenumbersearch...http://ai2.appinventor.mit.edu/?galleryId=6477875229491200ABGReplyallReplytoauthorForward0newmessages
延伸文章資訊
- 1while Loops in App Inventor 2 - YouTube
- 2MIT App Inventor Control Blocks
break
- 3Engineering and Debugging an App - AppInventor.org
Design the logic for your app before beginning to code. ... So, in designing this app, you might ...
- 4App inventor 教學講義chapter2 - SlideShare
條件選擇(Control 控制指令) 程式中的選擇(selection) 就是依. 程式區1; break; case value2: 程式區2; break; . for each ...
- 5Query about BREAK statement in Appinventor - Google Groups
to MIT App Inventor Forum. How to break out of current while loop in AI2? Please help! Tim Carter...