Announcement

Collapse
No announcement yet.

Error 70: Permission Denied

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

  • Michael K. Dealey
    replied
    Well, sure enough. Thanks Michael.

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

    Leave a comment:


  • Michael Mattias
    replied
    > 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).]

    Leave a comment:


  • Mel Bishop
    replied
    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).]

    Leave a comment:


  • Michael K. Dealey
    replied
    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).]

    Leave a comment:


  • Michael Mattias
    replied
    [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


    Leave a comment:


  • Mel Bishop
    replied
    I believe LOOP and WEND are interchangeable
    They are for a factus absolutius.

    This topic was covered before with (I think) MM. This little
    "feature" caused me a lot of grief in a program I was writing
    several years ago.

    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.

    I just re-read my 3rd paragraph and I hope it makes sense.

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


    [This message has been edited by Mel Bishop (edited April 04, 2005).]

    Leave a comment:


  • Tom Hanlin
    replied
    I believe LOOP and WEND are interchangeable.....

    ------------------
    Tom Hanlin, PowerBASIC Staff
    Opinions expressed may not be those of my employer or myself

    Leave a comment:


  • Robert E. Carneal
    replied
    Michael-

    While.....
    statements
    Wend

    IS the correct format. Now that you mention it, I am a little
    surprised I did not get a compile error.

    I typed While ... Loop because my first Basic course that was
    valid. Make that mistatke a lot in PB.

    I will try Michael's suggestion.

    Robert

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

    Leave a comment:


  • Michael K. Dealey
    replied
    I am confounded as to why you don't get a compile-time error. I don't have the DOS compiler installed to check, but is this legal syntax?

    Code:
    WHILE NOT EOF(1)
       ...
       WHILE Flagg = 1
       ..
       ..
       LOOP
       ...
    LOOP
    You are closing WHILE with "LOOP". It Should be WHILE..WEND. Also, maybe a typo but you did forget your NEXT statement in the FOR block as Allen pointed out. And as Michael Mattias said, you should definitely test for errors with your OPEN statements. Also a good Idea to use FREEFILE instead of hard coding the file handles.

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




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

    Leave a comment:


  • Tim Camarda
    replied
    Robert,

    Is this running under DOS, or as a DOS box under Windows, and what version?

    You could have a secure file where under Windows, trying to acces a
    file like WIN386.SWP would yield a permission denied. Under pure DOS However,
    the file is accessible.

    Tim www.omnixray.com


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

    Leave a comment:


  • Allen B. Zilbert
    replied
    Robert,

    I still do not see a Next statement in the code.

    Allen


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

    Leave a comment:


  • Barry Erick
    replied
    This is what the left square stuff looks like as you type it:


    Code:
       
    
    Code:
     
          FUNCTION Something that ends up like I want it() as long
               DIM Foo, Gym, Gold, Dirt as long
                 Dirt = 0
                 Gold = 455
                 For foo = Dirt to Gold
                     Gym = foo * Gold
                 Next
           End Function
    Using the code directive will keep your formatting.
    Hint: Paste the program code in following the bracketted code keyword, followed by the bracketted /code word.

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




    [This message has been edited by Barry Erick (edited April 04, 2005).]

    Leave a comment:


  • Michael Mattias
    replied
    Code:
    open FilenameIN$ for input as #1
    IF ERR THEN
       
    Open filenameOUT$ for output as #2
    IF ERR THEN
    ...
    You'd absolutely get an error on LINE INPUT if the open failed.

    This is exactly what I meant when I suggested the failure to handle an error <U>when it happens</U> can cause a spurious error later.




    [This message has been edited by Michael Mattias (edited April 04, 2005).]

    Leave a comment:


  • keith shelton
    replied
    Before you begin typing or pasting your code type left sqbracket code right sqbracket ie
    "
    Code:
      ", do this on a line by itself. 
    This will tell the software of the board to keep your formatting.
    When you are done with your code type in left sqbracket /code right sqbracket ie "
    "
    This will tell the board you are done with the formated code.
    "
    Code:
    "  The double quote are not used
    code here
    "
    "
    To see the code tags click the edit message icon.
    KS

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


    [This message has been edited by keith shelton (edited April 04, 2005).]

    Leave a comment:


  • Robert E. Carneal
    replied
    I knew I was going to leave something out! I sure didn't
    mean to skip the End If.

    The first three times when I typed this, I +did+ indent. So this
    time I thought I'd do better if I didn't indent.

    The mis-spelling of Looop was my fault in re-typing. It is Loop
    in the program.

    Any thoughts as to what could cause the Error 70? I am totally
    out of ideas.

    Robert

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

    Leave a comment:


  • Allen B. Zilbert
    replied
    Robert,

    One error that I noticed is that you spelled the external loop
    incorrectly within your code Looop. Also, try to avoid using
    multiple statements on one line. This will make your program
    easier to read as well as debug. You are missing a space in End If.
    I do not see a Next statement that corresponds with your For statement.
    You should try indenting, it too will make your code easier to read.

    Allen


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

    Leave a comment:


  • Robert E. Carneal
    replied
    I understand that the need to see the code. Ok, I will try it
    without formatting and see if that goes though. Thanks for
    bearing with me.
    ----------------
    FilenameIN$="C:\PDB\NPBD.DAT"
    FilenameOUT$="C:\PDB\NPDBO.DAT"

    open FilenameIN$ for input as #1
    Open filenameOUT$ for output as #2

    while not eof(1)
    Flagg=1
    while Flagg=1 :'{stops here}
    flagg=0 :'set flag :'{stops here}
    Input #1, CompleteLine$ :'{stops here}
    LineLen=len(CompleteLine$)
    NewLine$=""
    for I = 1 to LineLen
    TearOffTwo$=mid$(CompleteLine$,i,2)
    if TearOffTwo$ <> " " then
    NewLine$=NewLine$+TearOffTwo$
    else
    i=i+1 :'dont write the spaces, don't want the xtra spaces.
    Flagg=1 :' set the flag
    endif
    CompleteLine$=NewLine$
    loop

    Print #2, CompleteLine$ :'write the line back, minus xtra spaces.
    Looop :'get next line until done

    close all
    cls
    print "Done, Hombre."
    end

    I.e., if I line looks like this:
    "Facing West ","Anderson, Janice ","1880-7-12 ","1940---- "
    I want to change that to:
    "Facing West","Anderson, Janice","1880-7-12","1940----" and so on.....
    OBvisously +some+ spaces are necessary, but most are not.


    I put in braces {,} where the debugger stops. Not the same
    place every time. Here's hoping it goes thru this time. I hope
    I re-typed it correctly.
    Thank you so much guys.

    Robert

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

    Leave a comment:


  • Bob Zale
    replied
    Robert--

    If anyone is to help you, they must be able to see your code. Without it, there is only wild speculation.

    You've posted 3 messages here quite successfully. Try a fourth, in precisely the same fashion, and type in the appropriate code.

    Then folks can see what you have and suggest the cause and cure.

    Thanks!

    Bob Zale
    PowerBASIC Inc.


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

    Leave a comment:


  • Frank Cox
    replied
    I wonder if you are seeing a manifestation of the "error 70" that I describe in the thread about the "original" PB/DOS below.

    ------------------
    PB/DOS 3.5 on Fedora Linux

    Leave a comment:


  • Robert E. Carneal
    replied
    It is McAfee, not Norton. However, I have tried four times to
    post the code here. I type "
    Code:
    " and started typing. (It is
    not that long.)  Typed "
    " and I thought it went to the
    forum. Was it deleted?


    Thank you, and I will try turning off the McAfee.

    Robert

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

    Leave a comment:

Working...
X