Respond to this messageReturn to Index
Original Message
  • re: case updated
    • MATT (no login)
      Posted May 12, 2012 8:54 PM

      Ok,
      I'm not quite sure why i am having so much trouble getting this. It is my first time creating a program this complicated but it doesn't seem like it should be so difficult...

      Here is what I have so far.
      It seems to work fine the first loop around but then every other entry gives "was not found" and "IF LEN(STATE) = 0 THEN EXIT DO" seems to not work either. Any ideas? I'm sure it is something simple that I am missing here..

      SUB DeleteStates
      SHARED states() AS STRING
      DIM STATE AS STRING
      DIM x AS INTEGER
      DIM found AS INTEGER
      DO
      DO
      INPUT "Enter State: (blank to exit) "; STATE
      IF LEN(STATE) = 0 THEN EXIT DO
      found = 0
      FOR x = 0 TO maxstates - 1
      IF UCASE$(STATE) = UCASE$(states(x)) THEN
      found = 1
      states(x) = ""
      PRINT STATE; " was found and deleted.": EXIT DO

      ELSEIF found = 0 THEN
      PRINT
      PRINT STATE; " was not found in the array.": EXIT DO
      END IF
      NEXT x
      LOOP
      LOOP
      END SUB
    Your Name
    Your Email
    (Optional)
    Message Title
    Message Text
    Options Also send responses to my email address
          


     Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement