Announcement

Collapse
No announcement yet.

Error 70: Permission Denied

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    [quote]
    wanted to exit the Loop while inside the While. It only exited the Wend and I couldn't figure it out for a hoop of time.
    [quote]

    Code:
    WHILE 
      DO
       ' exit the DO:
         EXIT
       ' exit both DO and WHILE:
         EXIT, EXIT
      LOOP
    WEND
    MCM


    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #22
      Tom Hanlin wrote:

      I believe LOOP and WEND are interchangeable.....

      ------------------

      Mel Bishop wrote:
      They are for a factus absolutius.

      This topic was covered before ....
      I had a While/Wend nested inside a Do/Loop and wanted to exit
      the Loop while inside the While. It only exited the Wend and
      I couldn't figure it out for a hoop of time....


      Yes, it makes sense. I too have found need for this but didn't even consider it because I assumed it would not work.

      Is this an inteded "feature"? or something that just "happens" to work? I have never seen it documented.

      I did not know you could do what Michael Mattias pointed out:

      ------------------
      Code:
      WHILE 
        DO
         ' exit the DO:
           EXIT
         ' exit both DO and WHILE:
           EXIT, EXIT
        LOOP
      WEND
      MCM
      ------------------

      Anyway, we're getting off topic. Robert, have you made any progress?

      ------------------




      [This message has been edited by Michael K. Dealey (edited April 05, 2005).]

      Comment


      • #23
        Yes, it makes sense
        No, as a matter of fact, it doesn't make sense but that's the
        way it is.

        I wrote the following test program and it compiles, runs and
        operates as advertised.
        Code:
            $lib all off
            color 14,1
            cls
            open "somefile.txt" for input as #1    'needed for the While loop to have something to do
            
            do '<--------------------------------|
            while not eof(1) '<----------------| | While works just fine
            an$ = inkey$                       | |
            if an$ = chr$(32) then exit        | |
            if an$ = chr$(27) then exit, exit  | |
            loop '<----------------------------| | with this loop
                                                 | 
            beep                                 |
            loop '<------------------------------|
        ------------------




        [This message has been edited by Mel Bishop (edited April 05, 2005).]
        There are no atheists in a fox hole or the morning of a math test.
        If my flag offends you, I'll help you pack.

        Comment


        • #24
          > I did not know you could do what Michael Mattias pointed out

          From the help file, page two under EXIT
          Code:
          You may also use EXIT by itself, to automatically leave the most recently
          executed FOR/NEXT, WHILE/WEND, or DO/LOOP.  EXIT may be repeated, or even
          combined with ITERATE, to leave multiple levels of nested loops:
          
                   FOR i% = 1 TO 10                   FOR i% = 1 TO 10
                    DO                                 DO
                     DO                                 DO
                      EXIT,EXIT,ITERATE                  EXIT,EXIT,EXIT
                     LOOP                               LOOP
                    LOOP                               LOOP
                   NEXT                               NEXT

          [This message has been edited by Michael Mattias (edited April 06, 2005).]
          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #25
            Well, sure enough. Thanks Michael.

            ------------------

            Comment

            Working...
            X