[Gambas-user] Extern howto/tutorial

Doriano Blengino doriano.blengino at ...1909...
Sat Aug 28 09:05:37 CEST 2010


Benoît Minisini ha scritto:
>> Benoît Minisini ha scritto:
>>     
>>
> No: there is no HTML at all in your mail.
>   
Very strange. A friend of us picked the same document from the gambas 
list, and put it on the italian site of gambas (www.gambas-it.org). 
Anyway, I attach a tarred copy of the new document, which contains 
corrections.


>>> It is explicitely said that "WRITE #Pointer" is not supported anymore in
>>> Gambas 3, in the WRITE documentation page. And so on for the READ
>>> instruction.
>>>       
>> Sorry, I think that it is not so clear. "No more supported", or
>> equivalent semantics, is totally absent from the page. It is true that
>> there is a frame specifying the syntax for READ in Gambas3, but it
>> speaks only about "READ #Stream". This makes me think that the "READ
>> #Stream" syntax or behavior changed, not necessarily that pointers are
>> no more valid. Perhaps would be better to say something more in the
>> first frame, the one just below the title of the page: "WARNING! The
>> syntax has changed in Gambas 3. READ/WRITE with pointers is no more
>> supported in Gambas 3. See below."
>>     
>
> That is explicitetly mentioned in the READ & WRITE documentation page. See the 
> joined screenshot if you don't trust me. :-)
>   
My copy of the documentation is different. With all evidence, a 
correction about this topic was added after I downloaded the gambas 
sources from sourceforge. Anyway, the important thing is that now the 
documentation is correct.

> Note that 'WRITE #p, 0, 1' does not write one byte, but only the integer 0 on 
> four bytes. You must do 'WRITE #p, chr$(0), 1'
>
> WRITE #p, outq writes four bytes as outq is an integer, not one byte.
>
> And so on... I think you must check all your use of the WRITE instruction, 
> which write a number of bytes that depends on the datatype of its second 
> argument.
>   
I corrected the above errors, and attach the revised project.
It worked anyway, because the extraneous bytes written after the 
intended ones, were afterwards rewritten with correct values. Perhaps 
the compiler could reject statements like "write #p, 0, 1", or perhaps 
gambas2 is going to museum in favor of gambas3.

In a previous email I said that by declaring a constant as a byte, and 
then writing it out with a "write #pointer...", 4 bytes were written 
instead of one. This is not totally true - I did'nt verified. What is 
true, instead, is that declaring a constant as byte, and then writing it 
out to a stream, 4 bytes are written. This was verified in an old 
temptative of the drum machine, where OSS was used instead of alsa, and 
a gambas stream (file) was used to write to the file /dev/sequencer2.

Regards,
Doriano Blengino


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Gambas2-extern-howto.tgz
Type: application/x-gtar
Size: 14598 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20100828/b1e990f0/attachment.gtar>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Gambas2-DrumMachine-0.1.4.tar.gz
Type: application/x-tgz
Size: 15922 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20100828/b1e990f0/attachment.bin>


More information about the User mailing list