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.

DarkBASIC Discussion / help with my login plzzzz.

Author
Message
Armeggadon
23
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 14th Apr 2003 02:39 Edited at: 14th Apr 2003 02:42
i'm creating a login form for my game. i have the login form made but i want to know if its possible to add to it. say a name isn't on the list already. i want to know if it possible to register the name right away. i have it so that i can add a name and password but as soon as you close it and use it again the name isn't there. so my question is... can i set it so that when someone enters their name and password that isn't registered to register what would i do to keep their info there


as you can see the addname$ and addpass$ work until you rerun the program then the names leave the code. is there a way to keep the names in the code maybe using cookies.

Just ordered DBPro. After a lots of small things to learn, i plan on creating an Isometric RPG
I consider myself: ABSOLUTE NEWB!!!!!!!!!!
Hamish McHaggis
23
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 14th Apr 2003 03:03
Store your values in an array and use the "save array" and "load array" commands to retreave the values. Also your bit of code that confirmed the user name and password didn't quite work, you need to use this code instead...

print "CHECK: Username= ";
print addname$;
print "Password= ";
print addpass$
input "Is this correct[y/n]";yn$

Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Armeggadon
23
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 14th Apr 2003 03:17 Edited at: 14th Apr 2003 03:29
thank you sooooooooooooooo much. but could you please give an example of loading and saving an array. i read the tutorial but i dont quite get it.

Just ordered DBPro. After a lots of small things to learn, i plan on creating an Isometric RPG
I consider myself: ABSOLUTE NEWB!!!!!!!!!!
Dave J
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 14th Apr 2003 05:27
What's there not to get?

To Save an Array:


To Load an Array:


"Computers are useless they can only give you answers."
Armeggadon
23
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 14th Apr 2003 05:59
no no i meant how do i set up the array.

Just ordered DBPro. After a lots of small things to learn, i plan on creating an Isometric RPG
I consider myself: ABSOLUTE NEWB!!!!!!!!!!
minkus
23
Years of Service
User Offline
Joined: 18th Jan 2003
Location: My House
Posted: 14th Apr 2003 06:08
dim arrayname#/ /$(dimention 1, demention 2...)
you can have as many dimentions as you want

They say I'm crazy
but I'm actually REALLY crazy
Armeggadon
23
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 14th Apr 2003 06:17 Edited at: 14th Apr 2003 06:23
ummmmm ok i think. sry for all the trouble im causing. ill edit this post once i try it out.

[edit] ok i dont get it. im really sry. but how do i set up the array with usernames and passwords. say theres john, Bob, and Jill and there passwords are yawn, password, and test(respactively) how would i set that up in an array. also refer to my code in my first post to see what i have so far

Just ordered DBPro. After a lots of small things to learn, i plan on creating an Isometric RPG
I consider myself: ABSOLUTE NEWB!!!!!!!!!!
Hamish McHaggis
23
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 14th Apr 2003 16:27 Edited at: 14th Apr 2003 16:28
Alright, you would have the array "users$(4,2)" it has a $ on the end because it is a string array. You have to give it dimensions so you do this...

dim users$(4,2)

The different numbers represent 2 dimensions, like a 4x2 grid, so each combination of numbers in the brckets represents a different variable or square in the grid...

users$(1,1)="a"
users$(1,2)="b"
users$(2,1)="c"
users$(2,2)="d"
users$(3,1)="e"
users$(3,2)="f"
users$(4,1)="g"
users$(4,2)="h"

could be represented as...



A 4x2 grid with 8 possible values to be stored in it. So by changing the numbers in the brackets, you can store different values with the same variable.

The only reason that we use variables is that we can change their names using other variables, otherwise saying

array(1)=1
array(2)=2
array(3)=3

would be the same as

variable1=1
variable2=2
variable3=3

But with arrays, we can put them inside loops or select the right variable according to a choice from the player, without using if statements. Here is a for next example. With variables, you would have to write 100 commands to store 100 variables...

var1=1
var2=2
var3=3
var4=4
var...
.....

and so on. But with arrays we could compact 100 lines into 3!...

for x=1 to 100
array(x)=x
next x

Ta da!!!

You would probably want to do something like this for your code...



this loops through all the stored names and tests to see if the name entered is the same as the names already stored. If it is then say that the account exists and if it isn't the create the account.

Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Armeggadon
23
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 14th Apr 2003 23:42
oooooooooooooooooooooooooooh. ok wow. tha just made everything so much easier to understand. thank you. ill see how it works out.

Just ordered DBPro. After a lots of small things to learn, i plan on creating an Isometric RPG
I consider myself: ABSOLUTE NEWB!!!!!!!!!!

Login to post a reply

Server time is: 2026-06-11 17:31:19
Your offset time is: 2026-06-11 17:31:19