Re: Stopping error message in VB .NET



Hi

What I am looking for is something very common to do in ERP
applications.
For instance, in an ERP I can write a function with something like
this:

<code>
get_customer_information();
get_account_information();
post_invoice();
message("OK");
</code>

This will read some data from the customer and account tables and will
write some data for posting the invoice.

If there is some problem reading the customer table, I'll throw an
error and I'm sure that the code execution will not reach the
post_invoice() function. For instance,

function get_customer_information(){
...
...

if customer.name = "" then
error("Customer is nameless!"); // <--- This is the function I'd
like

...

}


Of course I could code my functions in order to so something like

if get_customer_information() then
if get_account_information() then
if post_invoice() then
message("OK");


But this forces me to keep track of errors and exit boolean values in
every function, which is cumbersome when you have a fairly big
application. I am used to work with really big ERP systems where that
is simply not an option.

What I'm trying is to adapt my programming ideas from the ERP to VB
..NET, if it is possible.

Thanks!


Toni

.