Is there a dialect of BASIC that ...

GFA, ASM, STOS, ...

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

MystikShadows
Atariator
Atariator
Posts: 26
Joined: Sun Mar 28, 2004 2:38 am

Is there a dialect of BASIC that ...

Postby MystikShadows » Tue Sep 18, 2018 5:02 pm

Supports the TYPE/END TYPE Construct of QB? on the atari st. I know the ACE Compiler had the STRUCT construct that did that. I'm looking for an equivalent thing for the ATARI ST.

This construct would be equivalent to struct in C or RECORD in Pascal.

Thank you all.

Stephane

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

Re: Is there a dialect of BASIC that ...

Postby lp » Wed Sep 19, 2018 1:34 pm

No BASIC I know of provides full blown structures. However, GFA can sort of simulate a single structure using the ABSOLUTE command. Not sure what the proper term is, but you can't create multiple instances of the same simulated structure. It's rather limited, but I've found it handy at times.

Code: Select all

' setup buffer for structure
INLINE adr%,8
' set offsets
ABSOLUTE var1%,adr%     !long
ABSOLUTE var2&,adr%+4   !word
ABSOLUTE var3|,adr%+6   !byte
' variables now reside at the address we defined
var1%=1
var2&=2
var3|=3
' verify contents of structure
PRINT LONG{adr%}
PRINT WORD{adr%+4}
PRINT BYTE{adr%+6}
' dumps 1,2,3 in the console
EDIT

User avatar
FatRakoon
Atari Super Hero
Atari Super Hero
Posts: 908
Joined: Sun Mar 11, 2007 3:27 am
Location: Behind the grassy knoll
Contact:

Re: Is there a dialect of BASIC that ...

Postby FatRakoon » Wed Sep 19, 2018 2:53 pm

First Basic ( comes with the ST )
Power Basic ( Nice and powerful, does most things )
HiSoft Basic ( extremely powerful, and can be built upon by using Libraries written in Assembly to write incredibly fast code )

Extremely close to QBasic on the PC, in fact I am sure that apart from the Machine specific things like GEM etc, the core of it is pretty much identical.

We used HiSoft Basic and QBasic when we were developing some networking apps in Uni, and we found that apart from the odd command, it was pretty much portable either way.
MSTE @ 16Mhz : 4MB+8MB : Magic & Jinnee
TT030 @ 32Mhz : 10+16MB : Magic & Jinnee
Falcon060 @ 95Mhz : 16+512MB : MiNT & Jinnee
More PCs than PC World has... Probably

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

Re: Is there a dialect of BASIC that ...

Postby lp » Wed Sep 19, 2018 3:25 pm

FatRakoon wrote:First Basic ( comes with the ST )
Power Basic ( Nice and powerful, does most things )
HiSoft Basic ( extremely powerful, and can be built upon by using Libraries written in Assembly to write incredibly fast code )

Extremely close to QBasic on the PC, in fact I am sure that apart from the Machine specific things like GEM etc, the core of it is pretty much identical.

We used HiSoft Basic and QBasic when we were developing some networking apps in Uni, and we found that apart from the odd command, it was pretty much portable either way.


But these don't allow structures. That's what he wants to know. Also HiSoft BASIC doesn't work correctly with MiNT. It hangs or crashes when you hit compile rendering it useless. That's what it did last time I tried it. Perhaps its ok if you like plain old TOS.

mlynn1974
Captain Atari
Captain Atari
Posts: 204
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: Is there a dialect of BASIC that ...

Postby mlynn1974 » Wed Sep 19, 2018 8:36 pm

STOS BASIC has the field instruction:

FIELD#channel,length1 AS field1$,length2 AS field2$....
Field allows you to define a record which will be
used for random access files. This record can
consist of up to 16 alphanumeric fields and can be
up to 65535 bytes long.

PUT#channel,r Writes the record created by FIELD into record
position r in the file.

GET#channel,r Reads the record r from the specified channel into
the field set up by the FIELD command.

This is good for writing fields to a file. A channel could be random file, MIDI, AUX (RS232) or PRT (printer) but not a memory stream.
This might a rather convoluted object but it does provide a record structure for reading and writing.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 6 guests