I'm going to try to explain this as best I can. I suck at explaining things.
here is the code I have and for some reason (probably obvious to you guys) it's not working.
MAXIPS = 2 `// this will be raised to 100 or more when I finally get it functioning.
DIM IP$(MAXIPS) `// IP address to be stored here.
IP$(0)="192.168.0.1" `// Dummy loaded into position 0 for testing.
DO `// Begining of main loop.
START: `// Lable for to return from the FOR NEXT loop
Print "hello"
Input "What IP would you like?",IP_NEW$ `// Get users desired IP address. This is only for testing purposes. I will have it randomly generating IP's when I'm done.
For t = 0 to MAXIPS `// I start at 0 because the array starts at 0. Could also do a 1 TO MAXIPS -1 but hey.
IF IP$(t) = IP_NEW$ `// Check to see if the IP exists already.
Print "Sorry, You have already been asigned that IP!" `// BAD person! BAD!
GOTO START `// Start over to get a different IP.
ELSE
IF IP$(t) <> IP_NEW$ AND IP$(t) = " " `// check to see that the array is holding something different then the users IP and equal to 0. (I had no idea how to check if a string equals 0 with the str$(0) command.
IP$(t) = IP_NEW$ `// save the users IP as an IP address in the array. At least that's the plan.
ENDIF
ENDIF
Next t
Print "Your IP has been saved!"
save array "Temp_IPS.txt",IP$(MAXIPS) `// Save IP array to a file for later reference. IE pull the existing IPs from the file so the user can choose one to use.
Print "Please press Up Arrow to quit."
IF UPKEY() =1 then end
wait key
loop
I have the random part working, I have the open and load array parts working. problem is saving the new users input to the array and then to a file.
Any Ideas?
Thx,
Joe
[Edit] Forgot to say thx
[/edit]
[edit] I figured it out. it simply needed a IP$(t)=""[/edit]