You're quite welcome. I enjoy helping on this kind of program. It looks good, and it seems to work correctly. I looked over it, and tested it very quickly, so I can't guarantee that it is correct, but I didn't see anything wrong. ----- There are two places where the code looks pretty similar to mine: DO X = X + 1 IF X = MAX THEN PRINT "!! The array is full !!": EXIT SUB LOOP WHILE LEN(STATES(X)) <> 0 But then, that is pretty straightforward code that does the job, so I would assume that's probably okay. This concerns me slightly more: DO MENU = INKEY$ SELECT CASE MENU CASE "1" TO "4": EXIT DO END SELECT LOOP SELECT CASE MENU CASE "1": ENTERSTATES 'sub CASE "2": DELETESTATES 'sub CASE "3": PRINTSTATES 'sub CASE "4": EXIT DO END SELECT That one I would suggest you might change. The reason I even had it that way was so that it would PRINT the keystroke if and only if the keystroke was a valid option. Since you took the PRINT out, then the main reason for having two SELECT CASE blocks goes away. The second SELECT CASE is probably okay, but you might simplify the DO...LOOP so that it exits anytime MENU is not empty. If it's a valid keystroke, the SELECT CASE will handle it. If not, the outer loop will repeat. DO MENU = INKEY$ LOOP UNTIL LEN(MENU) You might still PRINT the keystroke between the LOOP and the SELECT CASE. If it's invalid, the CLS at the top of the main loop will hide it. But then again, options 1 to 3 have CLSes also, so it might be moot. ----- I like that your PrintStates sub alphabetizes the array. Well done. :-) I'm slightly curious about this: INPUT "Press ENTER to return to menu: ", MENU IF LEN(MENU) = 0 THEN EXIT SUB LOOP That exits if the user enters a blank string, but loops the whole thing if the user enters a non-empty string. I'm a little curious about the purpose. ----- I hope your teacher won't mind that you've gotten assistance online. I don't think there is any problem with it, but I hope your teacher is okay with it. You'll probably be turning in a more refined program than your classmates, which could be unfair if they thought they shouldn't get assistance, and therefore didn't. Otherwise, I don't see a problem, as you are learning, and that's the purpose of the class in the first place. Regards, Michael |