🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #35421

Re: Modula2 Midi Programming Help!

#35421
From: Alan Lovejoy
Date: Fri, 16 Dec 1988 16:05
40 lines
1761 bytes
In article <3818@alvin.mcnc.org> houser@mcnc.org (Kevin D. Houser ) writes:
> In an effort to dump data to the midi ports on my Atari ST the following
>code was tried:

>     VAR
>       i:BYTE;
>     BEGIN
>       i:=$90
>          ^
           
> The compiler returned with a type not compatible error. So, how do I
>assign an 8bit value to the variable <i>? I am new to Modula2, so it may
>be trivial; but it is very important. Any help would be greatly appreciated.
>(I'm using TDI-Modula2/ST by the way)

The type BYTE in TDI Modula-2 (and most other modulas that have this
type) is identical in all respects to the type WORD save one: it is only
one byte instead of two (or four on some machines).  If the example had
been

VAR
  i: WORD;
BEGIN
  i := 90H;

then the problem might be more obvious to you:  type WORD (and type
BYTE) are NOT assignment compatible with ANYTHING that is not also
of type WORD (or BYTE).

If you want to get your code past the compiler, try:

  i := BYTE(90H);

Hope this helps.

-- 
Alan Lovejoy; alan@pdn; 813-530-8241; Paradyne Corporation: Largo, Florida.
Disclaimer: Do not confuse my views with the official views of Paradyne
            Corporation (regardless of how confusing those views may be).
Motto: If nanomachines will be able to reconstruct you, YOU AREN'T DEAD YET.
Technical Details
Message-ID: <5167@pdn.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!pdn!alan
References: <3818@alvin.mcnc.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!pdn!alan
From: alan@pdn.UUCP (Alan Lovejoy)
Newsgroups: comp.sys.atari.st,comp.lang.modula2
Subject: Re: Modula2 Midi Programming Help!
Keywords: MODULA2 MIDI BYTE HELP
Message-ID: <5167@pdn.UUCP>
Date: 16 Dec 88 16:05:57 GMT
References: <3818@alvin.mcnc.org>
Reply-To: alan@pdn.UUCP (0000-Alan Lovejoy)
Organization: Paradyne Corporation, Largo, Florida
Lines: 40