Loading ...
Sorry, an error occurred while loading the content.

Re: EOF Indicator/GOSUB

Expand Messages
  • milesinvestment
    Here s how I am accessing the file: open C: TEST.TXT for input as #1 if EOF(#1) 0 then 270
    Message 1 of 23 , Mar 1, 2012
    • 0 Attachment
      Here's how I am accessing the file:

      open "C:\TEST.TXT" for input as #1
      if EOF(#1) <> 0 then 270


      --- In libertybasic@yahoogroups.com, William Lopez <welopez@...> wrote:
      >
      >
      > File operations are fairly simpl and straight forward, but it is difficult to guess-timate what your error is without a few lines of the code you are using to obtain the input. No one is going to 'steal' your code. Why not post the portion which is giving you trouble?
      >
      > Bill
      >
      > welopez@...
      >
      > To: libertybasic@yahoogroups.com
      > From: milesinvestment@...
      > Date: Wed, 29 Feb 2012 22:32:19 +0000
      > Subject: [libertybasic] Re: EOF Indicator/GOSUB
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      > I am having trouble with the eof() also. It always shows 0. I'm. Thinking it might be the file itself.
      >
      >
      >
      > --- In libertybasic@yahoogroups.com, "Rod" <rodbird@> wrote:
      >
      > >
      >
      > > There is no trick to gosub / return they are very simple commands, What about eof() are you handling that correctly. Showing some code will get you the fastest fix.
      >
      > >
      >
      > > --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@> wrote:
      >
      > > >
      >
      > > > I am converting a Quickbasic program to Liberty Basic and am having trouble getting the GOSUB and Return mechanics to work correctly. Are there any tricks or software updates I'm missing?
      >
      > > >
      >
      > >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • paradisejb
      ... Your EOF line of code includes a shorthand version of GOTO 270, which will not RETURN. If you want the code to RETURN, you must use a GOSUB, ie: if
      Message 2 of 23 , Mar 1, 2012
      • 0 Attachment
        --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@...> wrote:
        >
        > Here's how I am accessing the file:
        >
        > open "C:\TEST.TXT" for input as #1
        > if EOF(#1) <> 0 then 270
        >
        Your EOF line of code includes a shorthand version of GOTO 270, which will not RETURN. If you want the code to RETURN, you must use a GOSUB, ie: "if EOF(#1) <> 0 then GOSUB 270". Could that be the issue you are talking about?
      • William Lopez
        In addition to the GOSUB which paradisejb just mentioned, see the helpfile for EOF(#h): [quote]This function is used to determine when reading from a
        Message 3 of 23 , Mar 1, 2012
        • 0 Attachment
          In addition to the GOSUB which paradisejb just mentioned, see the helpfile for EOF(#h): [quote]This function is used to determine when reading from a sequential file whether the end of the file has been reached. If so, -1 is returned, otherwise 0 is returned.
          Usage: open "testfile" for input as #1
          if eof(#1) < 0 then [skipIt]
          [loop]
          input #1, text$
          print text$
          if eof(#1) = 0 then [loop]
          [skipIt]
          close #1[/quote] If your EOF(#h) does not equal zero, you have reached the end of file and will exit the WHILE/WEND. If EOF(#h) does equal zero, you have not reached the end and there is more data to read. I suspect this is your problem. Your program is ending because it thinks it has read the entire file. Good luck to you!

          Bill

          welopez@...

          To: libertybasic@yahoogroups.com
          From: jburman1860@...
          Date: Thu, 1 Mar 2012 16:11:04 +0000
          Subject: [libertybasic] Re: EOF Indicator/GOSUB
































          --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@...> wrote:

          >

          > Here's how I am accessing the file:

          >

          > open "C:\TEST.TXT" for input as #1

          > if EOF(#1) <> 0 then 270

          >

          Your EOF line of code includes a shorthand version of GOTO 270, which will not RETURN. If you want the code to RETURN, you must use a GOSUB, ie: "if EOF(#1) <> 0 then GOSUB 270". Could that be the issue you are talking about?


















          [Non-text portions of this message have been removed]
        • milesinvestment
          All I know is that if I print EOF(#1) for say n=1 to 100 and the file is 75 lines long, it never goes to -1 signifying the end of the file, it errors out.
          Message 4 of 23 , Mar 1, 2012
          • 0 Attachment
            All I know is that if I print EOF(#1) for say n=1 to 100 and the file is 75 lines long, it never goes to -1 signifying the end of the file, it errors out.

            --- In libertybasic@yahoogroups.com, "paradisejb" <jburman1860@...> wrote:
            >
            >
            >
            > --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@> wrote:
            > >
            > > Here's how I am accessing the file:
            > >
            > > open "C:\TEST.TXT" for input as #1
            > > if EOF(#1) <> 0 then 270
            > >
            > Your EOF line of code includes a shorthand version of GOTO 270, which will not RETURN. If you want the code to RETURN, you must use a GOSUB, ie: "if EOF(#1) <> 0 then GOSUB 270". Could that be the issue you are talking about?
            >
          • William Lopez
            Oh! My goodness! A measley 4 GB! What does this mean? Probably the largest book I have on hand is the original, uncut, unabridged version of Stephen King s
            Message 5 of 23 , Mar 1, 2012
            • 0 Attachment
              Oh! My goodness! A measley 4 GB! What does this mean? Probably the largest book I have on hand is the original, uncut, unabridged version of Stephen King's "The Stand." In bound, hard-cover format, it is 1,152 pages. The weight is substantial and makes it inconvenient to carry along when flying or waiting in doctor's offices. I also have it in TXT format to read as an eBook, the file size is 2,582 KB. That means Just Basic can only read a file containing fewer than 1,549 complete copies of "The Stand." I cannot think of any reason I would need to store that many copies in a single file. I'm sure one could store the complete Encyclopedia Britannica plus the Oxford English Dictionary in fewer than 4GB, but I find looking up information on the web to be much easier. Of course, one can also purchase "The Stand" as an audio book, but I prefer reading a book myself rather than having "mommy" or some other person read it to me. Audio books are also significantly larger (file size) than TXT books. The point I wish to make is that the problem is more likely one of "data organization" rather than file size. If the US Army finds it necessary to keep a computer record of 30 million current or former service members (they do!), It would be far simpler to store the data alphabetically, or dates of service, or some other identifiable category, thereby breaking the total data into smaller chunks which provides easier storage and easier backup, without a significant loss of data. If there were a requirement to maintain a national registry of every car, truck, motorcycle, boat and airplane ever sold within the United States, probably the first thing the programmer would do would be to organize the data by state, making the file significantly smaller. Year of manufacture or year of sale might work also, providing some tracking of vehicles sold and resold several times were included. If you have an immense task, begin by breaking it down to smaller, separate tasks. You can easily record the serial number of the millions of stones in every pyramid by identifying the pyramid (Egyptian, Mayan, Aztec, or other), and then searching the category your stone falls into. "Divide and conquer" is an old maxim which is easy to accomplish using computers and files and you don't even have to break a sweat, you can do it from your air-conditioned cubicle. Credit reporting agencies maintain information regarding millions of individuals and organizations. I don't believe they keep all that data in a single file. The New York Stock Exchange and the American Stock Exchange record millions of transactions every hour they are open. Do you think they keep all that data in a single file? Try to imagine a simple and effective way to break your data file into identifiable chunks which will still let you search for a single entry.


              Bill

              welopez@...

              To: libertybasic@yahoogroups.com
              From: milesinvestment@...
              Date: Thu, 1 Mar 2012 15:07:26 +0000
              Subject: [libertybasic] Re: EOF Indicator/GOSUB




























              Here's how I am accessing the file:



              open "C:\TEST.TXT" for input as #1

              if EOF(#1) <> 0 then 270



              --- In libertybasic@yahoogroups.com, William Lopez <welopez@...> wrote:

              >

              >

              > File operations are fairly simpl and straight forward, but it is difficult to guess-timate what your error is without a few lines of the code you are using to obtain the input. No one is going to 'steal' your code. Why not post the portion which is giving you trouble?

              >

              > Bill

              >

              > welopez@...

              >

              > To: libertybasic@yahoogroups.com

              > From: milesinvestment@...

              > Date: Wed, 29 Feb 2012 22:32:19 +0000

              > Subject: [libertybasic] Re: EOF Indicator/GOSUB

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              > I am having trouble with the eof() also. It always shows 0. I'm. Thinking it might be the file itself.

              >

              >

              >

              > --- In libertybasic@yahoogroups.com, "Rod" <rodbird@> wrote:

              >

              > >

              >

              > > There is no trick to gosub / return they are very simple commands, What about eof() are you handling that correctly. Showing some code will get you the fastest fix.

              >

              > >

              >

              > > --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@> wrote:

              >

              > > >

              >

              > > > I am converting a Quickbasic program to Liberty Basic and am having trouble getting the GOSUB and Return mechanics to work correctly. Are there any tricks or software updates I'm missing?

              >

              > > >

              >

              > >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              >

              > [Non-text portions of this message have been removed]

              >


















              [Non-text portions of this message have been removed]
            • Carl Gundel
              Is your EOF test immediately after your OPEN statement as your example suggests? It needs to be inside a loop. -Carl Gundel Liberty BASIC for Windows -
              Message 6 of 23 , Mar 1, 2012
              • 0 Attachment
                Is your EOF test immediately after your OPEN statement as your example suggests? It needs to be inside a loop.

                -Carl Gundel
                Liberty BASIC for Windows - http://www.libertybasic.com
                Run BASIC, easy web programming - http://www.runbasic.com

                On Mar 1, 2012, at 10:07 AM, "milesinvestment" <milesinvestment@...> wrote:

                > Here's how I am accessing the file:
                >
                > open "C:\TEST.TXT" for input as #1
                > if EOF(#1) <> 0 then 270
                >
                >
                > --- In libertybasic@yahoogroups.com, William Lopez <welopez@...> wrote:
                >>
                >>
                >> File operations are fairly simpl and straight forward, but it is difficult to guess-timate what your error is without a few lines of the code you are using to obtain the input. No one is going to 'steal' your code. Why not post the portion which is giving you trouble?
                >>
                >> Bill
                >>
                >> welopez@...
                >>
                >> To: libertybasic@yahoogroups.com
                >> From: milesinvestment@...
                >> Date: Wed, 29 Feb 2012 22:32:19 +0000
                >> Subject: [libertybasic] Re: EOF Indicator/GOSUB
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >> I am having trouble with the eof() also. It always shows 0. I'm. Thinking it might be the file itself.
                >>
                >>
                >>
                >> --- In libertybasic@yahoogroups.com, "Rod" <rodbird@> wrote:
                >>
                >>>
                >>
                >>> There is no trick to gosub / return they are very simple commands, What about eof() are you handling that correctly. Showing some code will get you the fastest fix.
                >>
                >>>
                >>
                >>> --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@> wrote:
                >>
                >>>>
                >>
                >>>> I am converting a Quickbasic program to Liberty Basic and am having trouble getting the GOSUB and Return mechanics to work correctly. Are there any tricks or software updates I'm missing?
                >>
                >>>>
                >>
                >>>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >>
                >> [Non-text portions of this message have been removed]
                >>
                >
                >
                >
                >
                > ------------------------------------
                >
                > Yahoo! Groups Links
                >
                >
                >
              • milesinvestment
                Yes, it s in a loop with a max number greater than the file length.
                Message 7 of 23 , Mar 1, 2012
                • 0 Attachment
                  Yes, it's in a loop with a max number greater than the file length.

                  --- In libertybasic@yahoogroups.com, Carl Gundel <carlg@...> wrote:
                  >
                  > Is your EOF test immediately after your OPEN statement as your example suggests? It needs to be inside a loop.
                  >
                  > -Carl Gundel
                  > Liberty BASIC for Windows - http://www.libertybasic.com
                  > Run BASIC, easy web programming - http://www.runbasic.com
                  >
                  > On Mar 1, 2012, at 10:07 AM, "milesinvestment" <milesinvestment@...> wrote:
                  >
                  > > Here's how I am accessing the file:
                  > >
                  > > open "C:\TEST.TXT" for input as #1
                  > > if EOF(#1) <> 0 then 270
                  > >
                  > >
                  > > --- In libertybasic@yahoogroups.com, William Lopez <welopez@> wrote:
                  > >>
                  > >>
                  > >> File operations are fairly simpl and straight forward, but it is difficult to guess-timate what your error is without a few lines of the code you are using to obtain the input. No one is going to 'steal' your code. Why not post the portion which is giving you trouble?
                  > >>
                  > >> Bill
                  > >>
                  > >> welopez@
                  > >>
                  > >> To: libertybasic@yahoogroups.com
                  > >> From: milesinvestment@
                  > >> Date: Wed, 29 Feb 2012 22:32:19 +0000
                  > >> Subject: [libertybasic] Re: EOF Indicator/GOSUB
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >> I am having trouble with the eof() also. It always shows 0. I'm. Thinking it might be the file itself.
                  > >>
                  > >>
                  > >>
                  > >> --- In libertybasic@yahoogroups.com, "Rod" <rodbird@> wrote:
                  > >>
                  > >>>
                  > >>
                  > >>> There is no trick to gosub / return they are very simple commands, What about eof() are you handling that correctly. Showing some code will get you the fastest fix.
                  > >>
                  > >>>
                  > >>
                  > >>> --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@> wrote:
                  > >>
                  > >>>>
                  > >>
                  > >>>> I am converting a Quickbasic program to Liberty Basic and am having trouble getting the GOSUB and Return mechanics to work correctly. Are there any tricks or software updates I'm missing?
                  > >>
                  > >>>>
                  > >>
                  > >>>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >>
                  > >> [Non-text portions of this message have been removed]
                  > >>
                  > >
                  > >
                  > >
                  > >
                  > > ------------------------------------
                  > >
                  > > Yahoo! Groups Links
                  > >
                  > >
                  > >
                  >
                • Rod
                  I suspect you have the eof() test in the wrong place. You can t simply read a line then check for eof() you have to check eof() before you attempt to read in
                  Message 8 of 23 , Mar 1, 2012
                  • 0 Attachment
                    I suspect you have the eof() test in the wrong place. You can't simply read a line then check for eof() you have to check eof() before you attempt to read in the next line.

                    I don't see you reading in a line from the file in the sample code. If you don't read from the file the file pointer never moves and eof() will never get to be -1

                    As everyone has said you will get much better help if you post your code. That way we can stop guessing and you can get an appropriate pointer or two.

                    --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@...> wrote:
                    >
                    > All I know is that if I print EOF(#1) for say n=1 to 100 and the file is 75 lines long, it never goes to -1 signifying the end of the file, it errors out.
                    >
                    > --- In libertybasic@yahoogroups.com, "paradisejb" <jburman1860@> wrote:
                    > >
                    > >
                    > >
                    > > --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@> wrote:
                    > > >
                    > > > Here's how I am accessing the file:
                    > > >
                    > > > open "C:\TEST.TXT" for input as #1
                    > > > if EOF(#1) <> 0 then 270
                    > > >
                    > > Your EOF line of code includes a shorthand version of GOTO 270, which will not RETURN. If you want the code to RETURN, you must use a GOSUB, ie: "if EOF(#1) <> 0 then GOSUB 270". Could that be the issue you are talking about?
                    > >
                    >
                  • William Lopez
                    Awww, Rod, that s much too simple. Isn t it more challenging to play 20-questions, or perhaps this version should be called 20-suggestions? By process of
                    Message 9 of 23 , Mar 1, 2012
                    • 0 Attachment
                      Awww, Rod, that's much too simple. Isn't it more challenging to play 20-questions, or perhaps this version should be called 20-suggestions? By process of elimination, we should get around to a solution to his problem eventually... if it has a solution. LOL!

                      Bill

                      welopez@...

                      To: libertybasic@yahoogroups.com
                      From: rodbird@...
                      Date: Thu, 1 Mar 2012 19:08:21 +0000
                      Subject: [libertybasic] Re: EOF Indicator/GOSUB




























                      I suspect you have the eof() test in the wrong place. You can't simply read a line then check for eof() you have to check eof() before you attempt to read in the next line.



                      I don't see you reading in a line from the file in the sample code. If you don't read from the file the file pointer never moves and eof() will never get to be -1



                      As everyone has said you will get much better help if you post your code. That way we can stop guessing and you can get an appropriate pointer or two.



                      --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@...> wrote:

                      >

                      > All I know is that if I print EOF(#1) for say n=1 to 100 and the file is 75 lines long, it never goes to -1 signifying the end of the file, it errors out.

                      >

                      > --- In libertybasic@yahoogroups.com, "paradisejb" <jburman1860@> wrote:

                      > >

                      > >

                      > >

                      > > --- In libertybasic@yahoogroups.com, "milesinvestment" <milesinvestment@> wrote:

                      > > >

                      > > > Here's how I am accessing the file:

                      > > >

                      > > > open "C:\TEST.TXT" for input as #1

                      > > > if EOF(#1) <> 0 then 270

                      > > >

                      > > Your EOF line of code includes a shorthand version of GOTO 270, which will not RETURN. If you want the code to RETURN, you must use a GOSUB, ie: "if EOF(#1) <> 0 then GOSUB 270". Could that be the issue you are talking about?

                      > >

                      >


















                      [Non-text portions of this message have been removed]
                    • Stefan Pendl
                      ... I am always using a construct like the one below. ---code start (watch for line wraps) open FileName$ for input as #file while not(eof(#file)) code to
                      Message 10 of 23 , Mar 1, 2012
                      • 0 Attachment
                        Am 01.03.2012 18:06, schrieb Carl Gundel:
                        > Is your EOF test immediately after your OPEN statement as your example suggests? It needs to be inside a loop.
                        >

                        I am always using a construct like the one below.

                        '---code start (watch for line wraps)

                        open FileName$ for input as #file
                        while not(eof(#file))

                        ' code to parse the file and
                        ' fill an array with the collected information

                        wend
                        close #file

                        '---code end

                        This is secure and easy to understand.
                        I wouldn't jump around in the code using GOTO or GOSUB, since I never
                        had a need to do so.

                        It is always best to collect the information before you use it and fill
                        an array with it.
                        This speeds up your program immensely compared to reading one entry at a
                        time and processing it immediately.


                        --
                        Stefan Pendl
                        http://stefanpendl.runbasichosting.com/

                        LB 4.04 Pro ... http://www.libertybasic.com/assist.html
                        LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                        LB Community Wiki .............. http://basic.wikispaces.com/
                        LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
                        LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

                        Books at http://www.lulu.com/ and http://www.amazon.com/
                        Alyce Watson ... APIs for Liberty BASIC
                        Carl Gundel .... Beginning Programming with Liberty BASIC

                        Windows 7 Home Premium 64-bit SP1
                        AMD Turion X2 RM-70 2GHz, 4GB RAM
                      • Gary Passmore
                        eof(#f) returns 0 (null chr) if the file has NOT been exhausted. Your not(eof(#file)) will have the opposite effect. Read the Help File, under EOF( #h ).
                        Message 11 of 23 , Mar 1, 2012
                        • 0 Attachment
                          eof(#f) returns 0 (null chr) if the file has NOT been exhausted.
                          Your "not(eof(#file))" will have the opposite effect.
                          Read the Help File, under "EOF( #h )."

                          ...from the world according to GaRPMorE


                          ________________________________
                          From: Stefan Pendl <pendl2megabit@...>
                          To: libertybasic@yahoogroups.com
                          Sent: Thursday, March 1, 2012 4:27 PM
                          Subject: Re: [libertybasic] Re: EOF Indicator/GOSUB


                           

                          Am 01.03.2012 18:06, schrieb Carl Gundel:
                          > Is your EOF test immediately after your OPEN statement as your example suggests? It needs to be inside a loop.
                          >

                          I am always using a construct like the one below.

                          '---code start (watch for line wraps)

                          open FileName$ for input as #file
                          while not(eof(#file))

                          ' code to parse the file and
                          ' fill an array with the collected information

                          wend
                          close #file

                          '---code end

                          This is secure and easy to understand.
                          I wouldn't jump around in the code using GOTO or GOSUB, since I never
                          had a need to do so.

                          It is always best to collect the information before you use it and fill
                          an array with it.
                          This speeds up your program immensely compared to reading one entry at a
                          time and processing it immediately.

                          --
                          Stefan Pendl
                          http://stefanpendl.runbasichosting.com/

                          LB 4.04 Pro ... http://www.libertybasic.com/assist.html
                          LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                          LB Community Wiki .............. http://basic.wikispaces.com/
                          LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
                          LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

                          Books at http://www.lulu.com/ and http://www.amazon.com/
                          Alyce Watson ... APIs for Liberty BASIC
                          Carl Gundel .... Beginning Programming with Liberty BASIC

                          Windows 7 Home Premium 64-bit SP1
                          AMD Turion X2 RM-70 2GHz, 4GB RAM



                          [Non-text portions of this message have been removed]
                        • Gary Passmore
                          VIS.:     open f$ for input as #f     while eof(#f)=0         line input#f,d$         print d$     wend     close#f     end
                          Message 12 of 23 , Mar 1, 2012
                          • 0 Attachment
                            VIS.:
                                open f$ for input as #f
                                while eof(#f)=0
                                    line input#f,d$
                                    print d$
                                wend
                                close#f
                                end
                            ...from the world according to GaRPMorE  

                            [Non-text portions of this message have been removed]
                          • Stefan Pendl
                            ... I have read the help many times and I use that construct successfully in my existing projects with the correct result. Did you try it? The line While
                            Message 13 of 23 , Mar 1, 2012
                            • 0 Attachment
                              Am 01.03.2012 23:13, schrieb Gary Passmore:
                              > eof(#f) returns 0 (null chr) if the file has NOT been exhausted.
                              > Your "not(eof(#file))" will have the opposite effect.
                              > Read the Help File, under "EOF( #h )."
                              >

                              I have read the help many times and I use that construct successfully in
                              my existing projects with the correct result.

                              Did you try it?

                              The line "While Not(Eof(#file))" can be translated into human language
                              as "While not at the end-of-file (do loop)".


                              --
                              Stefan Pendl
                              http://stefanpendl.runbasichosting.com/

                              LB 4.04 Pro ... http://www.libertybasic.com/assist.html
                              LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                              LB Community Wiki .............. http://basic.wikispaces.com/
                              LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
                              LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

                              Books at http://www.lulu.com/ and http://www.amazon.com/
                              Alyce Watson ... APIs for Liberty BASIC
                              Carl Gundel .... Beginning Programming with Liberty BASIC

                              Windows 7 Home Premium 64-bit SP1
                              AMD Turion X2 RM-70 2GHz, 4GB RAM
                            • Stefan Pendl
                              ... BTW, EOF() is not returning the null character, but the number/value zero. NOT() inverts the value, so zero gets -1 and any other value gets zero. IF..THEN
                              Message 14 of 23 , Mar 1, 2012
                              • 0 Attachment
                                Am 01.03.2012 23:42, schrieb Stefan Pendl:
                                > Am 01.03.2012 23:13, schrieb Gary Passmore:
                                >> eof(#f) returns 0 (null chr) if the file has NOT been exhausted.
                                >> Your "not(eof(#file))" will have the opposite effect.
                                >> Read the Help File, under "EOF( #h )."
                                >>

                                BTW, EOF() is not returning the null character, but the number/value zero.

                                NOT() inverts the value, so zero gets -1 and any other value gets zero.

                                IF..THEN treats zero as false and any other value as true.

                                Long story short, it works, just try it ;-)


                                --
                                Stefan Pendl
                                http://stefanpendl.runbasichosting.com/

                                LB 4.04 Pro ... http://www.libertybasic.com/assist.html
                                LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                                LB Community Wiki .............. http://basic.wikispaces.com/
                                LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
                                LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

                                Books at http://www.lulu.com/ and http://www.amazon.com/
                                Alyce Watson ... APIs for Liberty BASIC
                                Carl Gundel .... Beginning Programming with Liberty BASIC

                                Windows 7 Home Premium 64-bit SP1
                                AMD Turion X2 RM-70 2GHz, 4GB RAM
                              • Gary Passmore
                                Stepan, my apologies. Everything you say is right*. If I had realized it was your post to which I was replying, I might have been more careful. I am guilty of
                                Message 15 of 23 , Mar 1, 2012
                                • 0 Attachment
                                  Stepan, my apologies. Everything you say is right*. If I had realized it was your post to which I was replying, I might have been more careful. I am guilty of acting in haste. My bad. And now I have to go and eat some ashes. :(

                                  ...from the world according to GaRPMorE


                                  ________________________________
                                  From: Stefan Pendl <pendl2megabit@...>
                                  To: libertybasic@yahoogroups.com
                                  Sent: Thursday, March 1, 2012 5:42 PM
                                  Subject: Re: [libertybasic] Re: EOF Indicator/GOSUB


                                   

                                  Am 01.03.2012 23:13, schrieb Gary Passmore:
                                  > eof(#f) returns 0 (null chr) if the file has NOT been exhausted.
                                  > Your "not(eof(#file))" will have the opposite effect.
                                  > Read the Help File, under "EOF( #h )."
                                  >

                                  I have read the help many times and I use that construct successfully in
                                  my existing projects with the correct result.

                                  Did you try it?

                                  The line "While Not(Eof(#file))" can be translated into human language
                                  as "While not at the end-of-file (do loop)".

                                  --
                                  Stefan Pendl
                                  http://stefanpendl.runbasichosting.com/

                                  LB 4.04 Pro ... http://www.libertybasic.com/assist.html
                                  LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                                  LB Community Wiki .............. http://basic.wikispaces.com/
                                  LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
                                  LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

                                  Books at http://www.lulu.com/ and http://www.amazon.com/
                                  Alyce Watson ... APIs for Liberty BASIC
                                  Carl Gundel .... Beginning Programming with Liberty BASIC

                                  Windows 7 Home Premium 64-bit SP1
                                  AMD Turion X2 RM-70 2GHz, 4GB RAM



                                  [Non-text portions of this message have been removed]
                                • Stefan Pendl
                                  ... It doesn t matter, if the post is one of mine, we should always test things out before we blame someone for misinformation. A simple example: ---code
                                  Message 16 of 23 , Mar 1, 2012
                                  • 0 Attachment
                                    Am 02.03.2012 02:02, schrieb Gary Passmore:
                                    > Stepan, my apologies. Everything you say is right*. If I had realized it was your post to which I was replying, I might have been more careful. I am guilty of acting in haste. My bad. And now I have to go and eat some ashes. :(
                                    >

                                    It doesn't matter, if the post is one of mine, we should always test
                                    things out before we blame someone for misinformation.

                                    A simple example:

                                    '---code start (watch for line wraps)

                                    Open "test.txt" for output as #outFile
                                    For i = 1 to 10
                                    #outFile "line "; i
                                    Next
                                    Close #outFile

                                    Open "test.txt" for input as #inFile
                                    While Not(Eof(#inFile))
                                    line input #inFile, contents$

                                    print contents$
                                    Wend
                                    Close #inFile
                                    End

                                    '---code end


                                    --
                                    Stefan Pendl
                                    http://stefanpendl.runbasichosting.com/

                                    LB 4.04 Pro ... http://www.libertybasic.com/assist.html
                                    LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                                    LB Community Wiki .............. http://basic.wikispaces.com/
                                    LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
                                    LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

                                    Books at http://www.lulu.com/ and http://www.amazon.com/
                                    Alyce Watson ... APIs for Liberty BASIC
                                    Carl Gundel .... Beginning Programming with Liberty BASIC

                                    Windows 7 Home Premium 64-bit SP1
                                    AMD Turion X2 RM-70 2GHz, 4GB RAM
                                  • Lorne Russell
                                    How can I change the background color of a textbox after the window and the textbox have been opened? Thanks, Lorne Russell [Non-text portions of this message
                                    Message 17 of 23 , Mar 4, 2012
                                    • 0 Attachment
                                      How can I change the background color of a textbox after the window and the textbox have been opened?

                                      Thanks,

                                      Lorne Russell



                                      [Non-text portions of this message have been removed]
                                    • Rod
                                      Nearly everyone has asked you to show your problem in code. Be nice if you would comply. You are failing to describe your problem in words
                                      Message 18 of 23 , Mar 5, 2012
                                      • 0 Attachment
                                        Nearly everyone has asked you to show your problem in code. Be nice if you would comply. You are failing to describe your problem in words
                                      • Stefan Pendl
                                        ... There are two ways: 1) the simple one is to create another text box with the other color and show/hide them accordingly 2) the complicated one is to use
                                        Message 19 of 23 , Mar 5, 2012
                                        • 0 Attachment
                                          Am 05.03.2012 04:32, schrieb Lorne Russell:
                                          > How can I change the background color of a textbox after the window and the textbox have been opened?
                                          >

                                          There are two ways:

                                          1) the simple one is to create another text box with the other color
                                          and show/hide them accordingly

                                          2) the complicated one is to use the Windows API and WMLiberty,
                                          see http://www.b6sw.com/forum/viewtopic.php?t=376


                                          --
                                          Stefan Pendl
                                          http://stefanpendl.runbasichosting.com/

                                          LB 4.04 Pro ... http://www.libertybasic.com/assist.html
                                          LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe

                                          LB Community Wiki .............. http://basic.wikispaces.com/
                                          LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
                                          LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/

                                          Books at http://www.lulu.com/ and http://www.amazon.com/
                                          Alyce Watson ... APIs for Liberty BASIC
                                          Carl Gundel .... Beginning Programming with Liberty BASIC

                                          Windows 7 Home Premium 64-bit SP1
                                          AMD Turion X2 RM-70 2GHz, 4GB RAM
                                        Your message has been successfully submitted and would be delivered to recipients shortly.