Re: yabasic problem

2018-08-20 Thread Richard Owlett

I'll not pursue strace further at this time.
As to programming language, I have the choice of either BASIC or Tcl.
I've not used BASIC in years.
I'm learning Tcl using tcltutor30b7. I've verified my program logic with 
yabasic. Tcltutor gives handy diagnostics. I'm translating my code to 
Tcl. It is a learning experience ;/


On 08/20/2018 10:11 AM, to...@tuxteam.de wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, Aug 20, 2018 at 06:55:19AM -0500, Richard Owlett wrote:

[...]


However if you do:
   > strace -o mytrace yabasic test.bas
it executes, but doesn't apparently doesn't give any explanation ow
why the two files cannot be opened.


Hm. You will have realized that strace's output is extremely chatty:
you'll see the open for all possible libraries your program tries
to get hold of, then typically, after that succeeded, mmaping those
libraries into the process's address space, many failed attempts
at opening config and auxiliary files (in search of them at different
possible locations) until the program is where you consider it "up
and running".

You'll have to wade through it. Ah -- and if the program is just a
wrapper calling other processes, you'll have to tell strace to follow
them (option -f). For example (I use the option '-f', although I know
that 'cat' doesn't fork):

   strace -o /tmp/trace -f cat /no/such/file

I get the (expected) error:

   cat: /no/such/file: No such file or directory

and my /tmp/trace contains:

   4157  execve("/bin/cat", ["cat", "/no/such/file"], [/* 26 vars */]) = 0
   4157  brk(NULL) = 0x55850a279000
   4157  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
   4157  mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0x7f7c303fc000

   # here you see the loading of the binary (execve), allocating memory (brk),
   # start of the search for the "interpreter" for the binary, etc.

   # lots of lines elided (roughly 85, in your program they'll be
   # quite a few more

   4157  fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
   4157  open("/no/such/file", O_RDONLY)   = -1 ENOENT (No such file or 
directory)

   # this is the failed attempt at opening "/no/such/file"

   4157  write(2, "cat: ", 5)  = 5
   4157  write(2, "/no/such/file", 13) = 13
   4157  open("/usr/share/locale/C.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 
ENOENT (No such file or directory)
   4157  open("/usr/share/locale/C.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 
ENOENT (No such file or directory)
   4157  open("/usr/share/locale/C/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT 
(No such file or directory)
   4157  write(2, ": No such file or directory", 27) = 27
   4157  write(2, "\n", 1) = 1

   # and this is the output of the error message to stderr (file descriptor 2)

   4157  close(1)  = 0
   4157  close(2)  = 0
   4157  exit_group(1) = ?
   4157  +++ exited with 1 +++

   # cleanup and exit.


*HOWEVER* perhaps my system and strace do not "play well together".
A tutorial I found gave as a first example:  > strace -o mytrace
yabasic ls
That gave 10 {apparently spurious} file errors before running "ls" normally.


See above: since libraries and other auxiliary files can be at one of
several places, many open errors are just the normal noise due to "looking
around".

Strace's output can be at first overwhelming, but it's a good tool
to have around.


Now to solve logic flaws in my code ;/


Ah, that's the true joy :-)

Cheers
- -- t
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlt62hcACgkQBcgs9XrR2kauygCfYQHujYlJno4qvZ7bqOKvSKBG
CN4An3yyNA0JFRQiyF/5uce+yIbNtuzv
=h0BJ
-END PGP SIGNATURE-








Re: yabasic problem

2018-08-20 Thread Thomas Schmitt
Hi,

Richard Owlett wrote:
> With a good filename, nothing printed.
> With a bad filename, it reports file not found.

But it does not abort at that point, does it ?

When the file name is bad, is the resulting filenumber 0 ?
If not: Can you read or write to that filenumber ?

I cling so massively to the theory of a sticky error indicator because
that is exactly what the indicator variable "errno" does in C and what
is described in man 3 errno.


Read The Source Luke:

peek$("error") is probably implemented in
  https://sources.debian.org/src/yabasic/1:2.79.2-1/function.c/#L1582
which hands out a copy of variable "errorstring".

A search for "errorstring" by
  https://codesearch.debian.net/search?q=package%3Ayabasic+errorstring
yields only one match where this variable's content is reset. That's
when it gets created at yabasic startup:
  https://sources.debian.org/src/yabasic/1:2.79.2-1/main.c/?hl=116#L117

All other occasions fill it with new error texts or put it out.
So it does not get cleared when command "open" succeeds.

See its implementation in
  https://sources.debian.org/src/yabasic/1:2.79.2-1/io.c/?hl=683#L683
The message
  "No such file or directory"
probably stems from the C function strerror(3) via my_strerror()
  https://sources.debian.org/src/yabasic/1:2.79.2-1/io.c/?hl=683#L804
  https://sources.debian.org/src/yabasic/1:2.79.2-1/main.c/?hl=2402#L2406

To fix this stickiness of error indicators, i would insert at the start of
myopen() around
  https://sources.debian.org/src/yabasic/1:2.79.2-1/io.c/?hl=683#L701
the statement

  errorstring[0] = 0;
  errorcode = 0;

... or somewhere more upwards, in the big interpreter loop ...


Hey, that's something HP BASIC never allowed us. Peeking into its code
and making perky proposals.

-

> This project started out in Tcl, which I visualize as a super-BASIC.

How that ?
Tcl is a strange script language with the only adavantage that together
with its sibling Tk it is the GUI toolkit with the least dependencies.
But as procedural language it is really substandard.
It was an exercise in stubbornness to finish
  
https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/frontend/xorriso-tcltk
and i had to build a text parser into xorriso's C code because doing
proper unquoting in Tcl was flatly impossible to me.


> Due to inexperience I got lost in how Tcl handled my JSON data.

You perhaps used some of these ?
  https://wiki.tcl-lang.org/13419
Their number raises suspicion. Why so many of them ?


> Now that I have yabasic reading/writing files I've solved my program logic
> problems.

So you want a decent procedural language. That's a healthy wish.
But Tcl is really not such a language.


Have a nice day :)

Thomas



Re: yabasic problem

2018-08-20 Thread Thomas Schmitt
Hi,

Note: this mail is purely nostalgic and not about yaboot.

David Wright wrote:
> [HP 9845B] If they had a weak point, it was those little tape drives

I once had a hidden line removal program reading a 3D model from one
tape and writing the intermediate result to the other. Then i had to
change the first tape, load the next program, insert the final result
tape, and let the program gnaw the data back from the intermediate tape.
One could hear the computer work. When it was done, it beeped and
printed a screen dump on the thermo printer between the tapes.
And of course neither model nor result were allowed to be larger than
200 KB.


> sample is burning away in a
> vacuum on an incandescent filament with a lifetime of perhaps 20
> minutes, a bug report is their saying "Er, Houston, we have a
> problem". That's peer pressure.

This gives real time programming a whole new meaning.


> But the ability to
> interrogate and set any variable in the current context (which could
> be made very large with COM statements) was invaluable, as was the
> ability to PAUSE, EDIT, RUN and CONTINUE within seconds and be back
> running your sample.

Well, back then we were stupid enough to do such things and smart enough
to get away with them. OPTION BASE 1.


Have a nice day :)

Thomas



Re: yabasic problem

2018-08-20 Thread Richard Owlett

On 08/20/2018 08:49 AM, Thomas Schmitt wrote:

Hi,

Greg Wooledge wrote:

But if BASIC is working for someone out there, then hey, great.


Sure. I am still wondering what will be the final solution to Richard's
riddle. (The typo theory seems to have died now. Remains the sticky error
theory.)



I'll attempt to claim at least minimal sanity and common sense.
This project started out in Tcl, which I visualize as a super-BASIC.

Project precis: SeaMonkey can save bookmarks in two formats.
JSON which is lossless but not suitable for human.
HTML which is human friendly, but loses hierarchical information 
[critical for my purposes]

Due to inexperience I got lost in how Tcl handled my JSON data.
Now that I have yabasic reading/writing files I've solved my program 
logic problems. It's losing critical data. I have a strong suspicion 
that when it reads my input file it sees some data as a line terminator.


Now that I know my program logic is valid, I'll likely translate it into 
Tcl for which there is a friendly debugging tool - the code pane of 
tcltutor30b7.


As to:
   > strace -o mytrace2 ls
I did a power off/power on sequence. I got a 9.5kb file with 10 
instances of "ENOENT (No such file or directory)". If anyone is 
interested, I'll send them a copy.


As to:> As to problem doing:> Did you make experiments to verify or 
falsify my theory ?

E.g. by provoking an error different from "File not found" and then
checking whether this message sticks to peek().


With a good filename, nothing printed.
With a bad filename, it reports file not found.












Re: yabasic problem

2018-08-20 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, Aug 20, 2018 at 06:55:19AM -0500, Richard Owlett wrote:

[...]

> However if you do:
>   > strace -o mytrace yabasic test.bas
> it executes, but doesn't apparently doesn't give any explanation ow
> why the two files cannot be opened.

Hm. You will have realized that strace's output is extremely chatty:
you'll see the open for all possible libraries your program tries
to get hold of, then typically, after that succeeded, mmaping those
libraries into the process's address space, many failed attempts
at opening config and auxiliary files (in search of them at different
possible locations) until the program is where you consider it "up
and running".

You'll have to wade through it. Ah -- and if the program is just a
wrapper calling other processes, you'll have to tell strace to follow
them (option -f). For example (I use the option '-f', although I know
that 'cat' doesn't fork):

  strace -o /tmp/trace -f cat /no/such/file

I get the (expected) error:

  cat: /no/such/file: No such file or directory

and my /tmp/trace contains:

  4157  execve("/bin/cat", ["cat", "/no/such/file"], [/* 26 vars */]) = 0
  4157  brk(NULL) = 0x55850a279000
  4157  access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or 
directory)
  4157  mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0x7f7c303fc000

  # here you see the loading of the binary (execve), allocating memory (brk),
  # start of the search for the "interpreter" for the binary, etc.

  # lots of lines elided (roughly 85, in your program they'll be
  # quite a few more

  4157  fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
  4157  open("/no/such/file", O_RDONLY)   = -1 ENOENT (No such file or 
directory)

  # this is the failed attempt at opening "/no/such/file"

  4157  write(2, "cat: ", 5)  = 5
  4157  write(2, "/no/such/file", 13) = 13
  4157  open("/usr/share/locale/C.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 
ENOENT (No such file or directory)
  4157  open("/usr/share/locale/C.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 
ENOENT (No such file or directory)
  4157  open("/usr/share/locale/C/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT 
(No such file or directory)
  4157  write(2, ": No such file or directory", 27) = 27
  4157  write(2, "\n", 1) = 1

  # and this is the output of the error message to stderr (file descriptor 2)

  4157  close(1)  = 0
  4157  close(2)  = 0
  4157  exit_group(1) = ?
  4157  +++ exited with 1 +++

  # cleanup and exit.

> *HOWEVER* perhaps my system and strace do not "play well together".
> A tutorial I found gave as a first example:  > strace -o mytrace
> yabasic ls
> That gave 10 {apparently spurious} file errors before running "ls" normally.

See above: since libraries and other auxiliary files can be at one of
several places, many open errors are just the normal noise due to "looking
around".

Strace's output can be at first overwhelming, but it's a good tool
to have around.

> Now to solve logic flaws in my code ;/

Ah, that's the true joy :-)

Cheers
- -- t
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlt62hcACgkQBcgs9XrR2kauygCfYQHujYlJno4qvZ7bqOKvSKBG
CN4An3yyNA0JFRQiyF/5uce+yIbNtuzv
=h0BJ
-END PGP SIGNATURE-



[OT] Re: yabasic problem

2018-08-20 Thread David Wright
On Mon 20 Aug 2018 at 09:35:35 (+0200), Thomas Schmitt wrote:
> Hi,
> 
> i wrote:
> > > (Found the booklet. It's HP BASIC 3.0, not 2.0. Newest techology of 1985.)
> 
> David Wright wrote:
> > I thought we were up to version 4.0¹ by 1985,
> 
> Indeed, the booklet says "June 1984 ... First Edition".
> 
> I think i did not get to BASIC 4.0 because in 1986 i wrote a BASIC program
> which translated our other BASIC programs to C (with some handwork being
> left to do).
> 
> 
> > Would you agree, though, that "BASIC" is the language that must
> > have the biggest contrast between its well-endowed versions and
> > the most dire cr*p.
> 
> Well, back then i perceived HP BASIC as the best language of all. It made
> me boss on all those expensive HP machines (from 9845B to 9000/320).

For our purposes, that was true, and consequently we spent £20,000 on
a 9845 with a £1000/year contract (1979 prices). The back was well
populated with 16-bit GPIO, HPIB and RS232 interfaces. Later we bought
a 9836, before makiing the transition to HTBasic on 486DX/DOS5.0.

If they had a weak point, it was those little tape drives; I lost
count of the number we had replaced, and memories of rethreading the
tape under that plastic drive band. But I gained much kudos with
the engineers when I managed to rebuild one of the cassettes where
the band had come completely off.

> But C ran on all Unix workstations. And as soon as i became ambidextrous
> enough, i fell in love with the display manager of the Apollo Domain DN3000.
> 
> Microsoft's Visual Basic is said to have surpassed HP BASIC in the years
> later.

DOS6.22 was an incredibly stable platform for HTBasic. We ran NFS
clients (into linux servers) on it too (they only output; no input)
as well. The idea of exposing our instruments to Windows of the time
was laughable. These machines had to run non-stop with complete
reliability.

[…]

> > If you've not come across the 9845 machine, it was in my experience
> > unique, in that you could edit the program while it was executing,
> > not even having to pause it.
> 
> Yep. I have seen users countering Error 17 by hitting the EDIT key and
> throwing out the offending line. (One can imagine the effect on the
> collection of emerged CAD files. We got much less repair work after the
> users were re-seated to Apollo, DEC, and Sun where they had to submit
> a bug report when the program crashed.)

Ah, well there's the difference. When you're developing software
interactively that's controlling a machine analysing a sample (which
represents a foreign field trip and a week's chemistry lab work by
the person sitting next to you) and said sample is burning away in a
vacuum on an incandescent filament with a lifetime of perhaps 20
minutes, a bug report is their saying "Er, Houston, we have a
problem". That's peer pressure.

It was very rare to actually need that particular editing facility
(which IIRC you didn't get with the 9836). But the ability to
interrogate and set any variable in the current context (which could
be made very large with COM statements) was invaluable, as was the
ability to PAUSE, EDIT, RUN and CONTINUE within seconds and be back
running your sample.

Cheers,
David.



Re: yabasic problem

2018-08-20 Thread Thomas Schmitt
Hi,

Greg Wooledge wrote:
> But if BASIC is working for someone out there, then hey, great.

Sure. I am still wondering what will be the final solution to Richard's
riddle. (The typo theory seems to have died now. Remains the sticky error
theory.)


Have a nice day :)

Thomas



Re: yabasic problem

2018-08-20 Thread Richard Owlett

On 08/20/2018 07:29 AM, Mark Fletcher wrote:
Isn’t the problem that you misspelled “experimental” in your original 
file paths?


No 
I had misspelled it when creating the directory.
And, being a lousy typist, I copy-n-past whenever possible.
I had used Caja's Properties menu to get the path.
But there was a typo which I caught after my initial initial post
[A missing "." before the extension of the input file].



Mark
On Mon, Aug 20, 2018 at 21:13 Richard Owlett > wrote:


On 08/20/2018 02:35 AM, Thomas Schmitt wrote:
 > David Wright wrote:
 >  [snip]
 >> Would you agree, though, that "BASIC" is the language that must
 >> have the biggest contrast between its well-endowed versions and
 >> the most dire cr*p.
 >
 > Well, back then i perceived HP BASIC as the best language of all.
It made
 > me boss on all those expensive HP machines (from 9845B to 9000/320).
 > But C ran on all Unix workstations. And as soon as i became
ambidextrous
 > enough, i fell in love with the display manager of the Apollo
Domain DN3000.
 >
 > Microsoft's Visual Basic is said to have surpassed HP BASIC in
the years
 > later.
 >
 >
 >> Where would yabasic fit?

I think it would rate fairly well. I browsed the BASICs in the
repository and seemed best matched to my preferences, specifically
no GUI.

 >
 > It seems to be inspired by C (see the syntax of "open"). But why
use such
 > a C-BASIC when there is gcc, gdb and valgrind ?
 >
'Cause the last time I used C was about 4 *DECADES* ago ;}
Although I have programmed, I would claim to be a *programmer*.








Re: yabasic problem

2018-08-20 Thread Greg Wooledge
On Mon, Aug 20, 2018 at 03:26:20PM +0200, Thomas Schmitt wrote:
> Nevertheless, between C and shell there is few room for BASIC.
> C for what is complicated and must run fast.
> shell for what is rather simple and must be programmed fast.

In between C and shell, you've got a huge number of scripting languages,
like python, perl, tcl, ruby, etc.  I haven't seen anyone use BASIC
in years, because these other languages are generally better.

But if BASIC is working for someone out there, then hey, great.



Re: yabasic problem

2018-08-20 Thread Thomas Schmitt
Hi,

i wrote:
> > why use such a C-BASIC when there is gcc, gdb and valgrind ?

> 'Cause the last time I used C was about 4 *DECADES* ago ;}

This way you missed the everlasting joy of hunting bugs which trigger
SIGSEGV at some arbitrary point of program execution.
valgrind widely industrialized that hunt. But its reports can be nearly
as cryptic as the messages from gcc if you omitted a semicolon somewhere.

Nevertheless, between C and shell there is few room for BASIC.
C for what is complicated and must run fast.
shell for what is rather simple and must be programmed fast.


Back to the literal question:

I doubted that the "open" commands failed at all. A decent BASIC in dialog
mode should show the error message automatically. And the docs say that
a running BASIC program shall abort if "open" fails and is not wrapped in
an "if" command.
Instead i suspected that the messages of peek$("error") stem from other
earlier attempts to open files. You meanwhile reported that strace shows
such attempts.

Did you make experiments to verify or falsify my theory ?
E.g. by provoking an error different from "File not found" and then
checking whether this message sticks to peek().


But Mark Fletcher has a different theory, which should be verified:
> Isn’t the problem that you misspelled “experimental” in your original file
> paths?

Your directory name "expermental_copies" looks fishy indeed.

Did you really test by copy+paste to an "ls" command in a shell terminal
that your path in the BASIC commands is correct ?
Don't trust your eyes. Trust your mouse.


Have a nice day :)

Thomas



Re: yabasic problem

2018-08-20 Thread Mark Fletcher
Isn’t the problem that you misspelled “experimental” in your original file
paths?

Mark
On Mon, Aug 20, 2018 at 21:13 Richard Owlett  wrote:

> On 08/20/2018 02:35 AM, Thomas Schmitt wrote:
> > David Wright wrote:
> >  [snip]
> >> Would you agree, though, that "BASIC" is the language that must
> >> have the biggest contrast between its well-endowed versions and
> >> the most dire cr*p.
> >
> > Well, back then i perceived HP BASIC as the best language of all. It made
> > me boss on all those expensive HP machines (from 9845B to 9000/320).
> > But C ran on all Unix workstations. And as soon as i became ambidextrous
> > enough, i fell in love with the display manager of the Apollo Domain
> DN3000.
> >
> > Microsoft's Visual Basic is said to have surpassed HP BASIC in the years
> > later.
> >
> >
> >> Where would yabasic fit?
>
> I think it would rate fairly well. I browsed the BASICs in the
> repository and seemed best matched to my preferences, specifically no GUI.
>
> >
> > It seems to be inspired by C (see the syntax of "open"). But why use such
> > a C-BASIC when there is gcc, gdb and valgrind ?
> >
> 'Cause the last time I used C was about 4 *DECADES* ago ;}
> Although I have programmed, I would claim to be a *programmer*.
>
>
>


Re: yabasic problem

2018-08-20 Thread Richard Owlett

On 08/20/2018 02:35 AM, Thomas Schmitt wrote:

David Wright wrote:
 [snip] 

Would you agree, though, that "BASIC" is the language that must
have the biggest contrast between its well-endowed versions and
the most dire cr*p.


Well, back then i perceived HP BASIC as the best language of all. It made
me boss on all those expensive HP machines (from 9845B to 9000/320).
But C ran on all Unix workstations. And as soon as i became ambidextrous
enough, i fell in love with the display manager of the Apollo Domain DN3000.

Microsoft's Visual Basic is said to have surpassed HP BASIC in the years
later.



Where would yabasic fit?


I think it would rate fairly well. I browsed the BASICs in the 
repository and seemed best matched to my preferences, specifically no GUI.




It seems to be inspired by C (see the syntax of "open"). But why use such
a C-BASIC when there is gcc, gdb and valgrind ?


'Cause the last time I used C was about 4 *DECADES* ago ;}
Although I have programmed, I would claim to be a *programmer*.




Re: yabasic problem

2018-08-20 Thread Richard Owlett

On 08/19/2018 08:50 AM, Richard Owlett wrote:

On 08/19/2018 08:36 AM, to...@tuxteam.de wrote:
[snip


   - try running your program under strace: there you'll see which
 system calls are being issued, and perhaps gain some insight
 on where this "No such file..." (ENOENT) really happens and
 what argument values are being passed to the system call.

 (as a very short intro:

   strace -o  yabasic
   [do your thing]
   [exit]
   [go carefully with a pitchfork through your trace file
    looking out for your file names and for ENOENT]

 Holler here if you need help with strace. It's a handy tool
 in any hacker's toolbox.


Didn't know of strace. Just glanced at manpage. On my way out - pursue 
this afternoon.




MIXED results.

In the yabasic mode I was using {enter basic program and hit Enter twice 
to execute}, strace and yabasic do not "play well together". The basic 
program is never executed.


However if you do:
  > strace -o mytrace yabasic test.bas
it executes, but doesn't apparently doesn't give any explanation ow why 
the two files cannot be opened.


*HOWEVER* perhaps my system and strace do not "play well together".
A tutorial I found gave as a first example:  > strace -o mytrace 
yabasic ls

That gave 10 {apparently spurious} file errors before running "ls" normally.

I then tried some brute force trouble shooting and discovered that the 
problem was specifying a complete path to target files. I moved them to 
my home directory and all worked fine.


Now to solve logic flaws in my code ;/
Thank you.














Re: yabasic problem

2018-08-20 Thread Jim Popovitch



On August 20, 2018 7:35:35 AM UTC, Thomas Schmitt  wrote:
>Hi,
>
>i wrote:
>> > (Found the booklet. It's HP BASIC 3.0, not 2.0. Newest techology of
>1985.)
>
>David Wright wrote:
>> I thought we were up to version 4.0¹ by 1985,
>
>Indeed, the booklet says "June 1984 ... First Edition".
>
>I think i did not get to BASIC 4.0 because in 1986 i wrote a BASIC
>program
>which translated our other BASIC programs to C (with some handwork
>being
>left to do).
>
>
>> Would you agree, though, that "BASIC" is the language that must
>> have the biggest contrast between its well-endowed versions and
>> the most dire cr*p.
>
>Well, back then i perceived HP BASIC as the best language of all. It
>made
>me boss on all those expensive HP machines (from 9845B to 9000/320).
>But C ran on all Unix workstations. And as soon as i became
>ambidextrous
>enough, i fell in love with the display manager of the Apollo Domain
>DN3000.
>
>Microsoft's Visual Basic is said to have surpassed HP BASIC in the years later.
>

Before VB (early 1990s) there was  Microsoft Basic (Professional Development 
System) which iirc became quite popular in the late 80s.  

-Jim P.





Re: yabasic problem

2018-08-20 Thread Thomas Schmitt
Hi,

i wrote:
> > (Found the booklet. It's HP BASIC 3.0, not 2.0. Newest techology of 1985.)

David Wright wrote:
> I thought we were up to version 4.0¹ by 1985,

Indeed, the booklet says "June 1984 ... First Edition".

I think i did not get to BASIC 4.0 because in 1986 i wrote a BASIC program
which translated our other BASIC programs to C (with some handwork being
left to do).


> Would you agree, though, that "BASIC" is the language that must
> have the biggest contrast between its well-endowed versions and
> the most dire cr*p.

Well, back then i perceived HP BASIC as the best language of all. It made
me boss on all those expensive HP machines (from 9845B to 9000/320).
But C ran on all Unix workstations. And as soon as i became ambidextrous
enough, i fell in love with the display manager of the Apollo Domain DN3000.

Microsoft's Visual Basic is said to have surpassed HP BASIC in the years
later.


> Where would yabasic fit?

It seems to be inspired by C (see the syntax of "open"). But why use such
a C-BASIC when there is gcc, gdb and valgrind ?


> If you've not come across the 9845 machine, it was in my experience
> unique, in that you could edit the program while it was executing,
> not even having to pause it.

Yep. I have seen users countering Error 17 by hitting the EDIT key and
throwing out the offending line. (One can imagine the effect on the
collection of emerged CAD files. We got much less repair work after the
users were re-seated to Apollo, DEC, and Sun where they had to submit
a bug report when the program crashed.)


Have a nice day :)

Thomas



Re: yabasic problem

2018-08-19 Thread David Wright
On Sun 19 Aug 2018 at 17:03:26 (+0200), Thomas Schmitt wrote:
> Hi,
> 
> Curt wrote:
> > I ain't no programmer, but sure is butt ugly.
> 
> Yeah. This Yet-Another-BASIC lacks the ON ERROR GOTO gesture.
> (Found the booklet. It's HP BASIC 3.0, not 2.0. Newest techology of 1985.)

I thought we were up to version 4.0¹ by 1985, if you're referring to
Rocky Mountain BASIC. We ran it on HP 9836s; our 9845B³ was stuck
around version 2.1 because the entire OS was contained in ROMs².

By 1992 we had migrated all our programs to the TransEra HTBasic
"clone" running on variously DOS 3.3, 5.0 and 6.22. (HP
maintenance contracts cost a small fortune, though they were
absolutely comprehensive and, boy, did we test them.)

RMB's ON ERROR statement had not only GOTO, but GOSUB, CALL and
RECOVER options, though the latter two weren't useful for me.
Would you agree, though, that "BASIC" is the language that must
have the biggest contrast between its well-endowed versions and
the most dire cr*p. Where would yabasic fit?

¹98613-90051_Basic4.0_LangRef_Jul85.pdf is still on the web,
along with stacks of software and hardware manuals of the period,
²eg 09845-91083_asmDevRom_Mar80.pdf

³If you've not come across the 9845 machine, it was in my experience
unique, in that you could edit the program while it was executing,
not even having to pause it. The Assembler extension module mentioned
above was also unusual in that it executed on a coprocessor, so it
could run in parallel with the RMB program; and it also did not
answer to the keyboard's keys like [PAUSE] and [STOP].

Cheers,
David.



Re: yabasic problem

2018-08-19 Thread Thomas Schmitt
Hi,

Curt wrote:
> I ain't no programmer, but sure is butt ugly.

Yeah. This Yet-Another-BASIC lacks the ON ERROR GOTO gesture.
(Found the booklet. It's HP BASIC 3.0, not 2.0. Newest techology of 1985.)


Have a nice day :)

Thomas



Re: yabasic problem

2018-08-19 Thread Curt
On 2018-08-19, Richard Owlett  wrote:
>> 
>> I tried to look up their online documentation, but it's one of
>> those stupid javascript-only sites, and I tend to avoid that.
>> Attention economy? I can play that: they won't get mine.
>
> So somebody agrees with me.
> A well done HTML manual is in the Debian package.
> Thanks
>

I glanced at some doc and your manner of creating a variable is rather
opinionated.

You can test for successful file opening thusly:

 if (not open(#1,"test.dat","r")) print "Can't open the file!"

Opening test.dat in the current directory, reading and printing its
contents, which are:

 one two three 
 four five 
 six seven eight nine

code:

 open 1,"test.dat","r" 
 while(!eof(1))
  input #1 a$ 
  line input b$ 
  print "a$=\"",a$,"\", b$=\"",b$,"\"" 
 wend

To create a variable (and then open and read that):

 a=open("foo")
 input #a a$

I ain't no programmer, but sure is butt ugly.

-- 
"She was a blank wall, fresh painted." 
Louise Erdrich, Love Medicine



Re: yabasic problem

2018-08-19 Thread Richard Owlett

On 08/19/2018 08:36 AM, to...@tuxteam.de wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 19, 2018 at 08:00:31AM -0500, Richard Owlett wrote:

I've installed yabasic from the repository.

I invoked as:> richard@debian-jan13:~$

richard@debian-jan13:~$ yabasic

This is yabasic version 2.78.0,
built on i686-pc-linux-gnu at Mon Jan 23 14:17:02 UTC 2017

My code fragment is:

infile$  = 
"/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/prettytest0txt"
outfile$ = 
"/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/1stpass.txt"
fd_in=open("/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/prettytest0txt","r")
print peek$("error")
fd_out = open(outfile$,"w")
print peek$("error")


For both print peek$("error") I'm told "No such file or directory".
The file to be read EXISTS and belongs to "richard"


Most people here won't know what 'print' and 'peek' do. Things you
might want to check:

   - is yabasic trying to interpret print's first argument (i.e.
 those pesky 'peek()' as some kind of file descriptor or name
 where to print to?


According to the manual, "peek$("error")" is explicitly for diagnosing 
problems when opening a file.




   - try running your program under strace: there you'll see which
 system calls are being issued, and perhaps gain some insight
 on where this "No such file..." (ENOENT) really happens and
 what argument values are being passed to the system call.

 (as a very short intro:

   strace -o  yabasic
   [do your thing]
   [exit]
   [go carefully with a pitchfork through your trace file
looking out for your file names and for ENOENT]

 Holler here if you need help with strace. It's a handy tool
 in any hacker's toolbox.


Didn't know of strace. Just glanced at manpage. On my way out - pursue 
this afternoon.




I tried to look up their online documentation, but it's one of
those stupid javascript-only sites, and I tend to avoid that.
Attention economy? I can play that: they won't get mine.


So somebody agrees with me.
A well done HTML manual is in the Debian package.
Thanks




Cheers
- -- t
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlt5cmQACgkQBcgs9XrR2kYdwgCaAyvOm44ZmYkfmQsyBH7DOVbn
d4UAn3bJsq1dEoYlBdWpbAeLJ+ttbp7F
=jkYQ
-END PGP SIGNATURE-








Re: yabasic problem

2018-08-19 Thread Thomas Schmitt
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



Re: yabasic problem

2018-08-19 Thread tomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Sun, Aug 19, 2018 at 08:00:31AM -0500, Richard Owlett wrote:
> I've installed yabasic from the repository.
> 
> I invoked as:> richard@debian-jan13:~$
> >richard@debian-jan13:~$ yabasic
> >
> >This is yabasic version 2.78.0,
> >built on i686-pc-linux-gnu at Mon Jan 23 14:17:02 UTC 2017
> My code fragment is:
> >infile$  = 
> >"/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/prettytest0txt"
> >outfile$ = 
> >"/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/1stpass.txt"
> >fd_in=open("/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/prettytest0txt","r")
> >print peek$("error")
> >fd_out = open(outfile$,"w")
> >print peek$("error")
> 
> For both print peek$("error") I'm told "No such file or directory".
> The file to be read EXISTS and belongs to "richard"

Most people here won't know what 'print' and 'peek' do. Things you
might want to check:

  - is yabasic trying to interpret print's first argument (i.e.
those pesky 'peek()' as some kind of file descriptor or name
where to print to?

  - try running your program under strace: there you'll see which
system calls are being issued, and perhaps gain some insight
on where this "No such file..." (ENOENT) really happens and
what argument values are being passed to the system call.

(as a very short intro:

  strace -o  yabasic
  [do your thing]
  [exit]
  [go carefully with a pitchfork through your trace file
   looking out for your file names and for ENOENT]

Holler here if you need help with strace. It's a handy tool
in any hacker's toolbox.

I tried to look up their online documentation, but it's one of
those stupid javascript-only sites, and I tend to avoid that.
Attention economy? I can play that: they won't get mine.

Cheers
- -- t
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlt5cmQACgkQBcgs9XrR2kYdwgCaAyvOm44ZmYkfmQsyBH7DOVbn
d4UAn3bJsq1dEoYlBdWpbAeLJ+ttbp7F
=jkYQ
-END PGP SIGNATURE-



yabasic problem

2018-08-19 Thread Richard Owlett

I've installed yabasic from the repository.

I invoked as:> richard@debian-jan13:~$

richard@debian-jan13:~$ yabasic

This is yabasic version 2.78.0,
built on i686-pc-linux-gnu at Mon Jan 23 14:17:02 UTC 2017

My code fragment is:

infile$  = 
"/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/prettytest0txt"
outfile$ = 
"/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/1stpass.txt"
fd_in=open("/home/richard/Documents/cherrytree/edit_bookmarks/expermental_copies/prettytest0txt","r")
print peek$("error")
fd_out = open(outfile$,"w")
print peek$("error")


For both print peek$("error") I'm told "No such file or directory".
The file to be read EXISTS and belongs to "richard"

I'm running the i386 flavor of Debian Stretch on a 686 machine [ThinkPad 
T510]


Suggestions?
TIA