A try/catch/exception concept in unibasic would be great.
However to do it properly would probably require a fair bit of effort inside u2, as they would have to start exposing exceptions to the language e.g. file open/read/write problems, execute problems other runtime errors, what would the stop statement do, the on error clauses would maybe have to change, perhaps you could have a switch to handle warnings like variable not assigned a value as an exception etc. Also it would start some great conversations on exception handling, and the granularity of your try blocks - this subject comes up all the time on .net/java/javascript groups i belong to. From: [email protected] [mailto:[email protected]] On Behalf Of DavidJMurray (mvdbs.com) Sent: 07 February 2011 23:06 To: [email protected] Subject: Re: [U2] Does UV have a "BLOCK" command UniBasic, at times really, does need a try/except statement. Most modern programming languages have some variation on: TRY stuff stuff EXCEPT stuff stuff ELSE stuff stuff FINALLY It should not be that difficult to implement; maybe a request to Rocket might get it added to uniBasic? djm George Gallen-2 wrote: > > I want to setup a block of commands, and be able to exit out of the block > if needed. > Right now I use a LOOP/REPEAT with an EXIT statement before the REPEAT. > > ----- Learn and Do Excel and Share http://mvdbs.com http://mvdbs.com -- View this message in context: http://old.nabble.com/Does-UV-have-a-%22BLOCK%22-command-tp30867376p30868800 .html Sent from the U2 - Users mailing list archive at Nabble.com. _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _____ No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1204 / Virus Database: 1435/3428 - Release Date: 02/07/11 _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
