GFA BASIC TOSWIN2 and INPUT

GFA BASIC-related articles in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

GFA BASIC TOSWIN2 and INPUT

Postby peterlane » Tue Mar 29, 2016 1:11 pm

I downloaded GFA BASIC for the Firebee today (from http://gfa.atari-users.net/atari/html/gbe.htm), and have been experimenting with some simple programs.

I am using MINT (and XaAES).

Output (using PRINT) is working fine. I can compile a .APP program, and run it using TOSWIN2 to see the output.

However, as soon as I use INPUT, things go a bit funny.

e.g. this program

Code: Select all

LINE INPUT "What is your name? ",a$
PRINT "hello ",a$


When I run this in TOSWIN2, as I start to type, the cursor moves up a line on screen with each character I type in.

Is there a way to get input to work correctly under Mint (with or without TOSWIN2)? I would like to experiment with some simple text I/O programs using GFA BASIC.

I spent some time searching, but didn't find any solution. (There's a mention of a Bconin() problem in http://gfa.atari-users.net/stg/gfabasic.htm when using INP: is that the problem here?)
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2252
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: GFA BASIC TOSWIN2 and INPUT

Postby lp » Tue Mar 29, 2016 8:07 pm

GFA's input commands assume a single-tasking environment, as in the whole screen. If you close TOSWIN2's console window you will notice they work as expected, but then dirty up the desktop. I don't know if this is some oddness of TOSWIN2 or what, it's never worked for me either. If you are using the GBE library, you can do this instead:

Code: Select all

OPENW 1
CLEARW 1
LINE INPUT "What is your name? ",a$
PRINT "hello ",a$
~INP(2) !wait for a key press
CLOSEW 1


GFA will redirect PRINT and INPUT into it's own built in windows. These built in window commands are very simplistic, they will not auto buffer the contents, nor redraw if overwritten. They can be used in a GEM environment for tinkering around, to avoid messing up the desktop though. I recommend never using them for a finished application. ;)

Playmobil
Atari maniac
Atari maniac
Posts: 82
Joined: Fri Nov 13, 2015 7:40 pm

Re: GFA BASIC TOSWIN2 and INPUT

Postby Playmobil » Tue Mar 29, 2016 10:03 pm

Hello Lonney... Sorry for my english...

Why use LINE INPUT ?

And not just INPUT or INPUT #1 ?

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: GFA BASIC TOSWIN2 and INPUT

Postby peterlane » Tue Mar 29, 2016 10:42 pm

lp wrote:GFA's input commands assume a single-tasking environment, as in the whole screen. If you close TOSWIN2's console window you will notice they work as expected, but then dirty up the desktop. I don't know if this is some oddness of TOSWIN2 or what, it's never worked for me either.


Thank you. Your suggested work around does the job.

Playmobil wrote:Why use LINE INPUT ?


I can see just INPUT should be enough, though the manual says LINE INPUT has the difference that it will also accept a comma in the input string.
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html


Social Media

     

Return to “GFA BASIC”

Who is online

Users browsing this forum: No registered users and 1 guest