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 / While loop problems

Author
Message
MadBovine
18
Years of Service
User Offline
Joined: 17th Oct 2005
Location:
Posted: 23rd Mar 2006 03:40
Ok I'm having a problem with a while loop. The code is meant to take an input from the user, change it to lower case, then strip off all non-letter or number characters and return the shortened string.

Everytime I try to compile this function it gives me a "Command out of place at line xxx" error where the endwhile is at. I've tried ending every else if section, but that gives other errors. I'm trying to keep this code as fast as possible so I don't want to run 34 if statements, I just want it to check until it hits the one it corresponds with then go to the next character. If there is a better way to do this I would love to know, but I would also like to know why this code won't compile. Thanks in advance!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 23rd Mar 2006 13:20
use code tags to post your code

example:

{code}
...your code here
{/code}

replace {} with []

will yield this:


FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 24th Mar 2006 02:56
I can't see the code you posted, but this code does what it sounds like you want to do.



Insanity is just a state of mind
MadBovine
18
Years of Service
User Offline
Joined: 17th Oct 2005
Location:
Posted: 24th Mar 2006 05:10
Heh, I tried attaching it with the "source" window... After reading a few more posts I found another newbie to the forum had the same problem because it doesn't attach them for new users, silly me, lol.

Anyways, I was kinda sleep deprived the first time I wrote my code and found the silly error I made. Thanks for the help anyways guys, it's really appreciated! I have it working now (and faster, I switched from cascading Ifs to a Case selection) and as soon as I have it in a workable form I'll post it.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 25th Mar 2006 01:15
I like your forum name by the way... +
mine is translated to............... +



watch your back


FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
MadBovine
18
Years of Service
User Offline
Joined: 17th Oct 2005
Location:
Posted: 28th Mar 2006 07:57
As promised here is my code, very simple, but useful for taking user input and parsing it down to just lowercase letters and numbers:


Oh yeah, forgot to say that it is DBP.

Login to post a reply

Server time is: 2024-09-24 19:28:17
Your offset time is: 2024-09-24 19:28:17