Hi Bjornke, Like you, I'm still skeptical about how useful this really is. I'm sensing that LC coders who also work with other more traditional programming languages will be more comfortable with assert.
To answer your question though, one example might be a parameter to a function which is always expected to be one of a known series of values but during testing, it inadvertently gets called with a value that is not one of the known ones, maybe because of a typo. Depending on the logic of the function, that may result in a runtime error or it may result in the function not returning a correct value. An assert statement could check that the parameter has an expected value and raise an error if not. That might be particularly important in library handlers that are called from a user's code rather than from within your own code. You don't have to use assert to handle that situation of course, in fact I doubt there's any use of assert that can't be handled with some other programming construct. Bottom line is you don't have to use assert if you don't like it, but it does raise the question of why time was spent implementing it rather than any of the other promised features on the list. Pete lcSQL Software <http://www.lcsql.com> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html> On Thu, Feb 20, 2014 at 8:51 AM, Björnke von Gierke <b...@mac.com> wrote: > > On 20.02.2014, at 16:37, Richard Gaskin <ambassa...@fourthworld.com> > wrote: > > > The key point there is that both only catch things the engine considers > errors. > > > > Assert compliments those by providing for things which may be > syntactically correct and completely executable, yet are errors within the > context of the business logic of your app. > > > I'm not a smart man, and can't imagine any such error ever happening in a > program. Can you give a simple example where you'd use assert to catch that > kind of error? > > -- > > Use an alternative Dictionary viewer: > http://bjoernke.com/bvgdocu/ > > Chat with other RunRev developers: > http://bjoernke.com/chatrev/ > > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode