Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Questions about my code

Author
Message
Gingerkid Jack
19
Years of Service
User Offline
Joined: 15th May 2005
Location: UK
Posted: 20th Jun 2009 14:18 Edited at: 20th Jun 2009 14:19
You may have recently read that I created a small program for my dad and I because we play alot of xbox. I have completly re-written the code and I have a couple of questions about it.
Here is the code:


Ok,
Question 1:
Is there a way of simplifieing my code in any way. Maybe by using Functions?
Question 2:
A part of my code isn't working.

This part for my dad doesn't work however the part for me does work?? Any suggestions?

Finally Question 3:
Can anyone explain to me a good use of the CASE command to replace my many If this If that else commands.

Thanks alot in advance guys.

Jack

TheCleverGuyz
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 20th Jun 2009 14:28
Here is a Select Case example from your code.


"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
Gingerkid Jack
19
Years of Service
User Offline
Joined: 15th May 2005
Location: UK
Posted: 20th Jun 2009 19:24
Is there a way to make a case where if its not one of the two options it wont let you continue? So you have to re-enter it.

Also any suggestions why that peice of code doesn't work.?

TheCleverGuyz
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 20th Jun 2009 19:40 Edited at: 20th Jun 2009 19:41

Sorry, got three anklebiters underfoot, so haven't got a chance to debug your code ^_^

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
Gingerkid Jack
19
Years of Service
User Offline
Joined: 15th May 2005
Location: UK
Posted: 3rd Jul 2009 20:02
Anyone else?

TheCleverGuyz
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 4th Jul 2009 03:23
try using the case default, that would be for anything other than those other cases...
zeroSlave
15
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 4th Jul 2009 04:22
Question #2 It works for me, but try changing it to:


It gives more flexibility for case sensitive inputs. "dAd", "Dad", "daD", "JacK", JaCk", etc. perhaps this was the problem. I didn't try it before I made the change so I'm not sure.
Gingerkid Jack
19
Years of Service
User Offline
Joined: 15th May 2005
Location: UK
Posted: 4th Jul 2009 11:29 Edited at: 4th Jul 2009 11:31
EDIT:: Wait I've realised that I made a stupid mistake and i'm going to fix now.

Any Ideas?

Thanks.

TheCleverGuyz

Login to post a reply

Server time is: 2024-11-24 04:05:37
Your offset time is: 2024-11-24 04:05:37