View Single Post
Old 11-08-2007, 02:24 PM   #5 (permalink)
tikkus
Banned
 
Join Date: Nov 2003
Posts: 1,219
-3 Internets
Alright, awesome guys. Thanks a bunch.

For this, I'm throwing a string called errorMsg and just returning 1 to the main program. Now the obstacle is the pattern matching, was super easy in perl but will apparently be a hassle for C++. I suppose thats the point of the assignment, haha.

If I have an input (string) with 2 characters that can have all alphanumeric characters, what would be an intuitive way to handle that?

With my first name/last name throw block my conditions are:

Code:
if (tempEmp.lastName.length() > 30 || tempEmp.lastName < "A" || tempEmp.lastName > "z") { errorMsg = "Last Name in employee data file has incorrect format... Ending Program...\n" throw tempEmp.lastName; }
As you can see, I'm relying on the ascii values of the characters to determine valid input. There has to be a better way of looking at that.

Update: Got the thing working! Just need to refine my pattern matching and I'm home free. Thanks so much guys. FoH coders for the win.

Last edited by tikkus : 11-08-2007 at 02:33 PM.
tikkus is offline   Reply With Quote

 
Uberguilds Network