Hello Everyone again. I just cant figure out what is going wrong with this, so i have done a few new changes. can someone just run the code while connected to the net please. Thankyou
'***************************
'** Messenger **
'***************************
'make a dimension array (string) for the usernames.
DIM usernames$(100)
'---------------
'get username (no password either in this example)
INPUT "Please enter a username: "; userName$
'---------------
'connect to ftp server using the info of the ftp site you have.
FTP CONNECT "paradise-workshop.netfirms.com", "paradise-workshop", "yvcbz"
FTP SET DIR "www"
'---------------
'get the DATABASE.txt to copy onto the hard drive
'temporarily.
FTP GET FILE "DATABASE.txt", "DATABASE.txt"
'---------------
'open the file that is now on the hard drive.
OPEN TO READ 1, "DATABASE.txt"
'---------------
'put the usernames in the dim array by reading from the file.
index=1
index2=1
readLoop:
READ STRING 1, usernames$(index)
index=index+1
IF FILE END(1)=1 THEN GOTO endReadLoop
GOTO readLoop
endReadLoop:
CLOSE FILE 1
DELETE FILE "DATABASE.txt"
amountOfUsers=index
'---------------
'open file to write the usernames plus your own.
OPEN TO WRITE 1, "DATABASE.txt"
writeLoop:
IF index2=index1 THEN GOTO writeName
WRITE STRING 1, usernames$(index2)
index2=index2+1
GOTO writeLoop
writeName:
WRITE STRING 1, userName$
CLOSE FILE 1
'---------------
'put the updated file on the ftp site
FTP PUT FILE "DATABASE.txt"
'delete the file from your hardrive as it is not needed and will creat errors if kept.
DELETE FILE "DATABASE.txt"
'---------------
'print done and disconnect
FTP DISCONNECT
PRINT "DONE"
PRINT "Press escape"
xxxpetratxxx
B. R. W