Re: [Ql-Users] Quanta Library Guide

2012-04-20 Thread Daniele Terdina


 SuQcess starts with testing the validity of devices and directories to 
 prevent it from crashing later.
 For this the TK2 commands FTEST and FTYP are used but these don't seem to 
 work on the device names used by Q-emuLator.
 Is this just an issue with the non-registered version?
 Is there any way to test for Q-emuLator from S*Basic so I can skip the 
 test and hope for the best?


The unregistered version tries to emulate the original file drivers, which are 
not level 2.

On a registered copy of Q-emuLator, and with level 2 drivers enabled, 
FTEST(mdv1_) should return 0 and your check will succeed.

On the unregistered version it returns -7, and I think that's the correct 
behaviour: Although I can't currently check, I believe FTEST(mdv1_) would 
also return -7 when run on a QL, even if there is a cartridge in the drive. It 
would be interesting to check.

 

The problem is related to the FTEST command trying to open a file rather than a 
directory to verify its existance. In SMSQ/E a directory can be opened as a 
file, but in QDOS I don't think it can. The correct way to check for the 
validity of devices and directories would be to attempt to open a directory, 
not a file (TRAP#2 with D0=1 and D3=4 rather than D3=1).

 

 

There is no SuperBASIC keyword to test for Q-emuLator, but it would be easy to 
write one if needed, as there is a TRAP#1 command that can be used to detect 
Q-emuLator.

 

 

Daniele   
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] C68 and the Quanta Library Guide

2012-04-20 Thread Dave Walker

On 17 Apr 2012, at 12:24, Norman Dunbar nor...@dunbar-it.co.uk wrote:

 On 17/04/12 10:46, Norman Dunbar wrote:
 
 The compilation worked, but listed calls to strfnd as having the wrong
 number of arguments. I had three, as per online references, but it seems
 the definition in string_h only has two :
 
 strfnd(const char *, const char *)
 
 So, I fixed my code to remove the third (boolean) parameter, and
 compiled again.
 
 Which allowed it to compile ok, but running it (see below!) shows that it can 
 no longer use the LOCATE/CONTINUE commands to find data in the sorted field - 
 always returns no records found. The normal FIND command is ok.
 
 LOCATE uses strfnd() so I suspect it's been affected by the change to two 
 parameters from three..
 
 
 Checking the map file, I see _OSERR is undefined.
 
 I then changed all my own code to use errno_h and errno instead of
 _oserr, but that gave the same result, _OSERR is undefined.
 
 It may be because the DBAS library call fsd_open also sets _oserr on the
 event of any errors, so this last one might need some jiggery pokery to
 get around, but I'll appreciate some assistance on the remainder please.
 
 I'm still getting the undefined _OSERR error in the map file, but I noticed 
 that an executable was still being created. I took a chance and it runs ok! 
 Hence my ability to determine that LOCATE/CONTINUE (above) were not working.
 
 
 Interesting!
 
 
 Cheers,
 Norm.
 
 -- 
 Norman Dunbar
 Dunbar IT Consultants Ltd
 
 Registered address:
 Thorpe House
 61 Richardshaw Lane
 Pudsey
 West Yorkshire
 United Kingdom
 LS28 7EL
 
 Company Number: 05132767
 ___
 QL-Users Mailing List
 http://www.q-v-d.demon.co.uk/smsqe.htm

Norman,

The strfnd function is not a standard function in C so any you come across are 
implementation defined.  I am guessing that your code has one with different 
semantics to the library one (which if I remember correctly is based on the 
Lattice C implementation), so you need to have a #undef statement to hide the 
library implementation.   I would guess that the three argument version you 
mentioned uses the 3rd argument to define continue behaviour which is why the 
problem with LOCATE/CONTINUE.

The _oserr variable is different to errno.   The idea is that errno is used for 
standard errors and is part of the C standard while _oserr is used for ones 
that are specific to the implementation.   The standard _oserr variable is 
defined in the C startup module.   However since an extra underscore gets added 
when viewing at the linker level, I am guessing this means that your code 
refers to it without the leading underscore somewhere.   In this particular 
case you are getting away with it because it is a simple variable and not a 
label for executing code.

Dave Walker

Home:  01707 652791
Web:www.itimpi.com
Skype:  itimpi

Sent from my iPad3
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Raspberry Pi - starts

2012-04-20 Thread Malcolm Cadman
In message 4f8fe256.8070...@newlan.org, Bryan Horstmann 
b...@newlan.org writes


Hi Bryan,

Yes, every computer language has its own way of doing things, hence the 
variety.


Python seems to be in the middle ground, where it has features like the 
more complex C/C++ and Pascal, etc, and yet you do not have to all of 
that endless 'compiling' to see a result.


So like all the BASICS, it is interpreted as it is run.

One of the aims of the Pi, is to encourage programming, again, to users 
and especially younger users. To see a quick result.


It will be interesting to see whether this happens, and which computer 
languages actually then get used.



I've had a look at Python too, Malcolm, and found Python Languages  
Syntax Cheat Sheet.  Under basic arithmetic it says i=a%b   e.g. 11%3

2  I cannot make sense of that.  I'll just hope that we can get an
emulator and stick to SBASIC I know.  But if RS have 220,000 
outstanding orders, it'll be some time before I get one!


Bryan H.


On 17/04/2012 10:37, Malcolm Cadman wrote:
In message 
1334691190.17608.yahoomailclas...@web29403.mail.ird.yahoo.com, John 
Alexander acontractor...@yahoo.co.uk writes


Hi John,

Well done ... I guess you may be the first on this list ... :-)

In the meantime, I am starting to getting around to learning the 
Python programming language.


As you may guess, the link between Pi and Python names is not 
accidental in all this, either. As Python is the preferred programming 
language for the Pi. Well at least at this early stage.


For those who do not program, it also no accident that the Python 
programming language is directly termed after the Monty Python comedy.


The Tutorial with the Version that I have, on a PC, gets in early 
with  a variable definition termed SPAM ... which is an obvious 
reference  to one well known comedic sketch.


I guess that this will open up everyone's imagination and humour, too 
.




My RPi arrived yesterday ;)

http://youtu.be/6X2P7sVL-wU

--- On Tue, 17/4/12, Dilwyn Jones dil...@evans1511.fsnet.co.uk wrote:

From: Dilwyn Jones dil...@evans1511.fsnet.co.uk
Subject: Re: [Ql-Users] Raspberry Pi - starts
To: ql-us...@q-v-d.com
Date: Tuesday, 17 April, 2012, 18:33

Lee Privett wrote:


Someone already has atleast one emulator running on the Pi

http://www.raspberrypi.org/wp-content/uploads/2012/04/simcoupe.jpg

Looks good, but a QL emulator would be even better!

Dilwyn
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm




___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


--
Malcolm Cadman
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Raspberry Pi - starts

2012-04-20 Thread Tony firshman


On 19 Apr 2012, at 15:10, Malcolm Cadman q...@mcad.demon.co.uk wrote:

 In message 4f8fe256.8070...@newlan.org, Bryan Horstmann b...@newlan.org 
 writes
 
 Hi Bryan,
 
 Yes, every computer language has its own way of doing things, hence the 
 variety.
 
 Python seems to be in the middle ground, where it has features like the more 
 complex C/C++ and Pascal, etc, and yet you do not have to all of that endless 
 'compiling' to see a result.
 
 So like all the BASICS, it is interpreted as it is run.
Not quite the same.  Yes- superBasic runs uncompiled but errors only show when 
they are encountered.
Python  (and perl - my preference) compiles first, syntax errors show then and 
it stops with error display - often wildly confusing if things lke closing 
quotes (or a dreaded ';' in Perl) is missed. Only if it compiles does it run 
the program.
 
 
 One of the aims of the Pi, is to encourage programming, again, to users and 
 especially younger users. To see a quick result.
 
 It will be interesting to see whether this happens, and which computer 
 languages actually then get used.
 
One of the really great features of python is no {} structure or semi-colons - 
it relies on indenting. This imposes good layout, which I in fact always 
attempt in perl ( and C).

I always thought it was a pity superBasic demanded line numbers. They were not 
actually necessary, and if GOTO did not exist, not even used.
 
Tony

-- 
t...@firshman.co.ukhttp://firshman.co.uk  
Voice: +44 (0) 1442 828254  Fax: +44 (0) 1442 828255. Skype: tony firshman 
TF Services, 29 Longfield Road, Tring, Herts, HP23 4DG


___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Raspberry Pi - starts

2012-04-20 Thread Dilwyn Jones

So like all the BASICS, it is interpreted as it is run.
Not quite the same.  Yes- superBasic runs uncompiled but errors only show 
when they

are encountered.
Python  (and perl - my preference) compiles first, syntax errors show then 
and it stops
with error display - often wildly confusing if things lke closing quotes 
(or a dreaded ';' in

Perl) is missed. Only if it compiles does it run the program.


It will be interesting to see whether this happens, and which computer 
languages actually

then get used.


One of the really great features of python is no {} structure or 
semi-colons - it relies on indenting.

This imposes good layout, which I in fact always attempt in perl ( and C).

This all sounds very interesting and possibly a fairly straightforward 
language for S*BASIC users to learn. I notice there's versions of Python for 
Windows as well as Linux etc. Anyone know if a Python program written on one 
platform such as Windows, be run on another such as Linux? Guess if the 
programs are written and saved using a text editor there's a chance this 
might be possible, although probably endian issues might arise with numbers, 
for example? Admittedly I know nothing about Python (yet... - it looks 
interesting)


I always thought it was a pity superBasic demanded line numbers. They were 
not actually necessary,

and if GOTO did not exist, not even used.
I think QLiberator at least can compile without line numbers (never actually 
tried that). Perhaps George could tell us if Turbo can too.


GOTO and GOSUB are one thing, you can usually do without them. What about 
RESTORE line_number though?


Dilwyn 


___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] Raspberry Pi - starts

2012-04-20 Thread Tony firshman


On 20 Apr 2012, at 16:40, Dilwyn Jones dil...@evans1511.fsnet.co.uk wrote:

 So like all the BASICS, it is interpreted as it is run.
 Not quite the same.  Yes- superBasic runs uncompiled but errors only show 
 when they
 are encountered.
 Python  (and perl - my preference) compiles first, syntax errors show then 
 and it stops
 with error display - often wildly confusing if things lke closing quotes (or 
 a dreaded ';' in
 Perl) is missed. Only if it compiles does it run the program.
 
 It will be interesting to see whether this happens, and which computer 
 languages actually
 then get used.
 
 One of the really great features of python is no {} structure or semi-colons 
 - it relies on indenting.
 This imposes good layout, which I in fact always attempt in perl ( and C).
 
 This all sounds very interesting and possibly a fairly straightforward 
 language for S*BASIC users to learn. I notice there's versions of Python for 
 Windows as well as Linux etc. Anyone know if a Python program written on one 
 platform such as Windows, be run on another such as Linux? Guess if the 
 programs are written and saved using a text editor there's a chance this 
 might be possible, although probably endian issues might arise with numbers, 
 for example? Admittedly I know nothing about Python (yet... - it looks 
 interesting)
I don't really know python, but I am sure it is much like perl.

One has a first line for Linux - #!/usr/bin/perl/ - which points to the 
compiler.
Under windows one uses 'perl program name' - and it ignores the pointer, as it 
is a comment!
Any extra modules needed are loaded using 'include', again at the beginning.
There will be no issues with the code as long as these modules are there - 
usually.  However, especially in the area of gt lt etc, syntx changed. These 
languages though seem to be backward compatible in the main.
I always write witth a text editor, often on a different platform.
 
 I always thought it was a pity superBasic demanded line numbers. They were 
 not actually necessary,
 and if GOTO did not exist, not even used.
 I think QLiberator at least can compile without line numbers (never actually 
 tried that). Perhaps George could tell us if Turbo can too.
 
 GOTO and GOSUB are one thing, you can usually do without them. What about 
 RESTORE line_number though?
 
Ah I didn't know about that one, and have never used it.
 
Tony

-- 
t...@firshman.co.ukhttp://firshman.co.uk  
Voice: +44 (0) 1442 828254  Fax: +44 (0) 1442 828255. Skype: tony firshman 
TF Services, 29 Longfield Road, Tring, Herts, HP23 4DG
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm