Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4ppc Wishlist Missing any feature?

Proper Exception Handling

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-09-2010, 12:24 PM
RacingDog's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Fleet, Hants, UK
Posts: 183
Send a message via Yahoo to RacingDog
Default Proper Exception Handling

This is definitely long term as the implementation is non-trivial, but I could do with a proper exception handling mechanism. The Help indicates the problems of using a Goto for any reason. But it is worse than that.

If I write a module intended to be used generically using B4PPC, then if there is an error which cannot be handled by that module but needs handling by the calling software, there is no simple method of doing this. Simply having an public error variable, or an error return parameter, or error return value can put a severe strain on the user code as many places may then have to handle this.

For example, reading/writing .ini files. One may have many keys to read/write and any error in the file will be reported many times over for, not just once. You want one error, one report.

One way of solving this would be if it were possible to see the user's current error label possibly via some sort of access procedure. That is probably too grubby. By far the best is the Ada way, as copied by C++ etc, i.e. raise an exception.

I just happen to have such a module (no one surprised huh?), see attachment. You can see the two places where this is a problem quite easily, Select statements handling a value cError.

Anyway, I shan't hold my breathe on this one, it is obviously a bit fundamental.

For the wider readership.....
The module is simple. It is my take on how to simply read/write ini key strings. I included trivial support for handling full line comments the user may have manually added, as these are allowed in normal ini files. I drew a line at implementing partial line comments. So if anyone else wants to see an alternate view on this subject feel free to look, but you are on your own if you use it (maybe, I'm a softy really!)(it seems to work!?!?!).
Attached Files
File Type: bas INIFiles.bas (5.9 KB, 13 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Win32 Exception HARRY Questions (Windows Mobile) 5 11-02-2009 09:32 AM
Proper use of the .New methods, out of memory error kolbe Questions (Windows Mobile) 5 09-05-2008 01:37 PM
Build proper desktop apps in B4PPC with this awesome Forms library agraham Additional Libraries 25 07-30-2008 04:19 PM
SIP Exception davidmw Bug Reports 8 07-05-2007 04:32 PM
Exception Handling Astragali Questions (Windows Mobile) 2 05-23-2007 12:44 AM


All times are GMT. The time now is 02:11 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0