Error trapping

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
typon
Posts: 12
Joined: Thu Nov 04, 2004 11:18 am

Error trapping

Post by typon »

Hi ppl.

I need help on how to error trap number inputs really bad.

E.G.
If i need a user input value as real, and they enter "dfasdf", how do i error trap that

PLEASE HELP ME ASJHASFJAS

Archived topic from Iceteks, old topic ID:2996, old post ID:24640
User avatar
Red Squirrel
Posts: 29209
Joined: Wed Dec 18, 2002 12:14 am
Location: Northern Ontario
Contact:

Error trapping

Post by Red Squirrel »

What language?

Check if it has a function that checks if it's a number or not.

for example wit php you'd use preg_match to ensure it's a number and you could even limit how many digits as well.

Archived topic from Iceteks, old topic ID:2996, old post ID:24641
Honk if you love Jesus, text if you want to meet Him!
Athy
Posts: 16
Joined: Fri Jan 07, 2005 11:31 pm

Error trapping

Post by Athy »

As far as I know you can't errortrap letters if you need a number input, but I might be wrong. :grade11math:

<3 :banana:

Archived topic from Iceteks, old topic ID:2996, old post ID:24645
wtd
Posts: 157
Joined: Sat Sep 25, 2004 7:21 pm

Error trapping

Post by wtd »

Athy wrote: As far as I know you can't errortrap letters if you need a number input, but I might be wrong. :grade11math:

<3 :banana:
Of course you can. If you can determine what the numbers in the input were to do the conversaion, then you can certainly check to see if there are any letters that can be converted to numbers.

Archived topic from Iceteks, old topic ID:2996, old post ID:24646
typon
Posts: 12
Joined: Thu Nov 04, 2004 11:18 am

Error trapping

Post by typon »

umm im talking about turing.

PLEASE HELP WTD

Archived topic from Iceteks, old topic ID:2996, old post ID:24651
Athy
Posts: 16
Joined: Fri Jan 07, 2005 11:31 pm

Error trapping

Post by Athy »

wtd wrote:
Athy wrote: As far as I know you can't errortrap letters if you need a number input, but I might be wrong.  :grade11math:

<3  :banana:
Of course you can. If you can determine what the numbers in the input were to do the conversaion, then you can certainly check to see if there are any letters that can be converted to numbers.
Woah, must remember to yell at teacher! Lol!

<3

Archived topic from Iceteks, old topic ID:2996, old post ID:24656
wtd
Posts: 157
Joined: Sat Sep 25, 2004 7:21 pm

Error trapping

Post by wtd »

typon wrote: umm im talking about turing.

PLEASE HELP WTD
Type "strrealok" and hit F9.

Archived topic from Iceteks, old topic ID:2996, old post ID:24664
Athy
Posts: 16
Joined: Fri Jan 07, 2005 11:31 pm

Error trapping

Post by Athy »

wtd wrote:
typon wrote: umm im talking about turing.

PLEASE HELP WTD
Type "strrealok" and hit F9.
Cool! SO if you hit F9 it takes you to Turing Help?

Archived topic from Iceteks, old topic ID:2996, old post ID:24668
wtd
Posts: 157
Joined: Sat Sep 25, 2004 7:21 pm

Error trapping

Post by wtd »

F10 is general Turing help. F9 takes you to help related to the word in front of your cursor.

Archived topic from Iceteks, old topic ID:2996, old post ID:24672
Athy
Posts: 16
Joined: Fri Jan 07, 2005 11:31 pm

Error trapping

Post by Athy »

wtd wrote: F10 is general Turing help. F9 takes you to help related to the word in front of your cursor.
Cool, thanks, any shortcuts in Turing help.

Archived topic from Iceteks, old topic ID:2996, old post ID:24673
typon
Posts: 12
Joined: Thu Nov 04, 2004 11:18 am

Error trapping

Post by typon »

worked thanks
<3

Archived topic from Iceteks, old topic ID:2996, old post ID:24780
Locked