GET and BGET from channel

Anything QL Software or Programming Related.
Andrew
Chuggy Microdrive
Posts: 63
Joined: Tue Jul 17, 2018 9:10 pm

GET and BGET from channel

Postby Andrew » Tue Oct 30, 2018 9:00 pm

Is there any other function except BGET which reads a byte from a channel and can be compiled with Turbo ?
Same question for GET - as the SuperBasic manual states "Current versions of the Turbo and Supercharge compilers are not able to compile programs which use GET ad BGET"

I am writing a program that uses them and it needs to be compiled when it is ready, to increase the speed. I prefer not to use many other toolkits that need to be loaded for the program to work, so I used only SuperBasic and Toolkit II - but probably i will also use PE if I am too lazy to write a routine to save and restore the screen when I show pop-up windows.

Alternative is to use QLiberator to compile, but I would prefer Turbo for speed.


User avatar
dilwyn
Mr QL
Posts: 1379
Joined: Wed Dec 01, 2010 10:39 pm
Location: Wales
Contact:

Re: GET and BGET from channel

Postby dilwyn » Tue Oct 30, 2018 9:40 pm

Bget #channel,byte use
Byte=code(inkey$(#channel))

Vanilla superbasic has no method of setting file pointer (like bget\) that works consistently across rom versions. There is a largely undocumented PAN (see Simon Goodwin's bugs articles) which is able to, but only on some rom versions. You may be able to use turbo toolkit extensions -not home as i write this to check manual.

GET uses the internal formats, not easy from 'vanilla' basic. Again turbo toolkit might have broadly equivalent extensions if you have a manual to check.

EDIT: i think the turbo toolkit extensions to look up are POSITION and SET_POSITION for file pointer positioning and GET% (for integer GET), GETF for float get and GET$ for string get, but as functions (as opposed to a proc keyword such as toolkit 2 GET)


Dilwyn
All things QL: see www.dilwyn.me.uk
User avatar
tofro
QL Wafer Drive
Posts: 1436
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: GET and BGET from channel

Postby tofro » Tue Oct 30, 2018 9:46 pm

Really current versions of Turbo are perfectly capable of compiling GET and BGET. George Gwilt has done a tremendous job several years ago implementing support for Machine Code commands that modify their parameters.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
dilwyn
Mr QL
Posts: 1379
Joined: Wed Dec 01, 2010 10:39 pm
Location: Wales
Contact:

Re: GET and BGET from channel

Postby dilwyn » Tue Oct 30, 2018 9:53 pm

I suppose the only real reason for using the turbo tk equivalents is to allow your program to run on a system without TK2.


Dilwyn
All things QL: see www.dilwyn.me.uk
User avatar
tofro
QL Wafer Drive
Posts: 1436
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: GET and BGET from channel

Postby tofro » Tue Oct 30, 2018 9:58 pm

Dilwyn,

When compiling "vanilla QL" programs, I normally link TK2 (or whatever toolkit I use) into the compiled binary - That allows it to run on systems that have no Toolkit on board.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Andrew
Chuggy Microdrive
Posts: 63
Joined: Tue Jul 17, 2018 9:10 pm

Re: GET and BGET from channel

Postby Andrew » Tue Oct 30, 2018 10:37 pm

Thank you Dilwyn and Tofro. If Turbo can compile GET and BGET then it is great !

Dilwyn - the Turbo manual i have says that Turbo toolkit does have Get% (reads integer), GetF (reads a float) and Get$ - but there is no function to read a single byte.

As this is my first QL program in the last 30 years and I will probably have more questions to ask - and will need some help to compile it.
But it is fun to write it !
The navigation is ready - now working on commands and viewers.
Attachments
Capture.JPG


User avatar
dilwyn
Mr QL
Posts: 1379
Joined: Wed Dec 01, 2010 10:39 pm
Location: Wales
Contact:

Re: GET and BGET from channel

Postby dilwyn » Tue Oct 30, 2018 11:01 pm

Screen dump looks good! Good luck finishing that program. Let us know how it goes.
So my memory didn't do too bad for Turbo TK extensions then (given that i'm on a ferry back after a long day in Ireland - and while there i got to meet former QL trader Darren Branagh, the Q-Celt himself!! ) :geek:
Tobias: the old Reconfigurable TK2 was very useful to link into compiled programs which needed to run on small memory systems as it allowed you to include only the subset you needed for that application. Nowadays it's probably too old compared to modern TK2s of course.


Dilwyn
All things QL: see www.dilwyn.me.uk

Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 2 guests