Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #199015

Re: yabasic problem

From "Thomas Schmitt" <scdbackup@gmx.net>
Newsgroups linux.debian.user
Subject Re: yabasic problem
Date 2018-08-19 15:50 +0200
Message-ID <wowfD-1Xx-1@gated-at.bofh.it> (permalink)
References <wovCW-1KV-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

i still have a HP BASIC 2.0 Quick Reference somewhere ...

Richar Owlett wrote:
> fd_in=open("/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/prettytest0txt","r")
> print peek$("error")

Although the open() call does not really look like BASIC, it is authorized
by http://www.yabasic.de/yabasic.htm#ref_open

But shouldn't you test fd_in for failure (i.e. whether it is 0 after the
call) ?

The description of peek$("error") indicates that your BASIC program
should not even reach the message print command if open() failed.
It does not promise that the error indicator is reset when a new open()
or seek() is performed.
  http://www.yabasic.de/yabasic.htm#ref_peek

> Suggestions?

#ref_peek suggests
  if you use open as a condition (e.g. if (open(#1,"foo")) …) the outcome
  (success or failure) of the open-operation will determine, if the
  condition evaluates to true or false. If now such an operation fails,
  your program will not be terminated and you might want to learn the
  reason for failure. This reason will be returned by peek("error")
 (as a number) or by peek$("error") (as a string)


Mandatory deviation from literally answering the original question:
Even considering all sweet nostalgy, i would still stay with C as language.


Have a nice day :)

Thomas

Back to linux.debian.user | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-19 15:10 +0200
  Re: yabasic problem <tomas@tuxteam.de> - 2018-08-19 15:40 +0200
    Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-19 16:00 +0200
      Re: yabasic problem Curt <curty@free.fr> - 2018-08-19 16:30 +0200
        Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-19 17:10 +0200
          Re: yabasic problem David Wright <deblis@lionunicorn.co.uk> - 2018-08-20 01:30 +0200
            Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 09:40 +0200
              Re: yabasic problem Jim Popovitch <jim@k4vqc.com> - 2018-08-20 10:00 +0200
              Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 14:20 +0200
                Re: yabasic problem Mark Fletcher <mark27q1@gmail.com> - 2018-08-20 14:40 +0200
                Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 15:40 +0200
                Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 15:30 +0200
                Re: yabasic problem Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-20 15:40 +0200
                Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 16:00 +0200
                Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 18:10 +0200
                Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 19:50 +0200
              [OT] Re: yabasic problem David Wright <deblis@lionunicorn.co.uk> - 2018-08-20 17:10 +0200
                Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-20 18:50 +0200
      Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 14:00 +0200
        Re: yabasic problem <tomas@tuxteam.de> - 2018-08-20 17:20 +0200
          Re: yabasic problem Richard Owlett <rowlett@cloud85.net> - 2018-08-20 21:40 +0200
  Re: yabasic problem "Thomas Schmitt" <scdbackup@gmx.net> - 2018-08-19 15:50 +0200

csiph-web