
-----------------------------------
magicman
Tue Oct 05, 2004 8:29 am

error traping
-----------------------------------
i need to now how to make error trapping

-----------------------------------
wtd
Tue Oct 05, 2004 10:19 am


-----------------------------------
What kind of "error" do you need to "trap"?

In Java, errors are generally indicated by "exceptions".  When the program runs into something wrong, it throws an exception.  You can then handle that exception, including a specific chunk of code to run if the exception occurs.

A tutorial on exception handling is provided here.

http://www.compsci.ca/v2/viewtopic.php?t=1534

-----------------------------------
magicman
Wed Oct 06, 2004 7:47 am


-----------------------------------
well i need error trapping for some thing like this
------------
if (weapon.equals ("simple weapons"))
        {
            c.println ("Pick the type of weapon");
            c.println ("gauntlet");
            c.println ("dagger");
            c.println ("morningstar");
            c.println ("longspear");
            c.println ("crossbow");

        }
--------------

like if they spell it worng or capalise is or some thing like that...

-----------------------------------
Andy
Wed Oct 06, 2004 3:54 pm


-----------------------------------
read wtd's post.. has everything u need
