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 / Turning a password into asterisks

Author
Message
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 4th Jan 2004 03:38
After a lot of trial and error and thing that I thought might fix my problems, I have decided to come here to help.

I'm writing a program that turns a real string into a string full of asterisks for passwords. Not really "turns it into" one, but it fills a different string with asterisks depending on the length of the real input.

However, my problems are weird ones. The first one is a problem on my part with the use of right$(), I'm sure, but for some reason when I hit backspace, it deletes the entire string rather than just the rightmost character. I'm not sure why this is happeneing.

The second problem is the strangest. Sometimes, even when I hit backspace to delete the entire string, for some reason one blank character will still remain. The length function returns one, and one asterisk is printed. It seems as though, however, that if i hit backspace enough it will go away. I'm not sure at all what the problem is.

Can anyone help?



My friends' and my website for programming:
http://unseenstudios.dbpcommunity.com
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 4th Jan 2004 05:29 Edited at: 4th Jan 2004 05:29
You should be useing left$ not right$.


Also you can't use maths on strings. a$+b$ joins the strings together. In dbpro ;,+,-,* or / join the 2 strings together, but you should use + or ;.

This is how I would do the same thing.


Where you use a simple counter(typetime) may be ok on your comp but the counter will reach 45 a lot quicker on some computers than others. You should use the timer() to check if a certain time has elapsed or do as I do and don't except the input if it is the same key as the last loop.

dbpro : 2ghz p4m : 512mb : geforce 4 4200 go
MasterInsan0
21
Years of Service
User Offline
Joined: 14th May 2003
Location: United States
Posted: 4th Jan 2004 06:18
Yes, I thought of using a timer but this is simply an application to get the thing working correctly. The timer would have been in the final version. However, it's obviously no longer necessary, thanks to you. Thanks for the speedy response.

I only encountered one problem, and that was when commenting it and moving it around a little to match my coding style, and that was that I couldn't separate "if returnkey() then repeat until returnkey()=0 : stop = 1" from their single line. It would cause the program to skip ahead to the "Press a key to exit." I'm not entirely sure why, but as long as it works it's fine by me.

My friends' and my website for programming:
http://unseenstudios.dbpcommunity.com
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 4th Jan 2004 08:01
If you want t make it multiline replace it with



dbpro : 2ghz p4m : 512mb : geforce 4 4200 go
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 7th Jan 2004 07:46
here's a simple code





I hope it help.

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!
demons breath
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 7th Jan 2004 22:39 Edited at: 7th Jan 2004 22:41
Quote: "Also you can't use maths on strings. a$+b$ joins the strings together"


isn't there a value command or anything? (There is in VisualBASIC - I used it for making a calculator and it would probably be something like
. Sorry I can't check this at the moment - my computers a bit messed up today.

Am I the only one here who's really confused?
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 7th Jan 2004 22:46
Someone asked this question a little while ago, and I posted code very similiar to Commandos. Do a forum search

RPGamer


We need help! Email us! join@eternaldestinyonline.com
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 7th Jan 2004 23:00
Yeah,that was me

Is just of those days when you don't wanna wake up everything is *****, everybody sucks you really don't know why, but you wanna justify rippin' someone head off!

Login to post a reply

Server time is: 2024-09-21 15:56:14
Your offset time is: 2024-09-21 15:56:14