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 / setting a str$ code?

Author
Message
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 14th Sep 2008 19:09
hi how would u set a str$ variable but not have it in your code??

im trying to make a password,so whoever plays it needs to enter a password but i dont want to enter my password into my code like this... mypassword$="password"

is it possible to have a password without entering it into your code???
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 14th Sep 2008 19:48
You can read it from a file, like so:

open to read 1,"filename.ext"
read string 1,password$
close file 1

Or encrypt it: (You need my not-yet-released function pack)

open to read 1,"filename.ext"
password$ = read_encrypted_string(1,"touhdmnd9nidglhmndg")
close file 1

Or access it from the command line:

password$ = cl$()

Or mess up your code:

password$ = LEFT$("pants",2) + RIGHT$("pants",1) + "sword"

The optomist's right, The pessimist's right.

Login to post a reply

Server time is: 2024-09-27 20:22:07
Your offset time is: 2024-09-27 20:22:07