Re: [fpc-pascal] Empty record inside another record ?

2008-02-24 Thread Skybuck Flying

Finally there is another question remaining:

Are objects always packed ?

If not then it could be a problem.

Something which records do allow.

Bye,
 Skybuck.

- Original Message - 
From: Daniël Mantione [EMAIL PROTECTED]

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Saturday, February 16, 2008 5:24 PM
Subject: Re: [fpc-pascal] Empty record inside another record ?




Op Fri, 15 Feb 2008, schreef Skybuck Flying:


To me it seems like some kind of trick, to extend a record at runtime.

The empty record field, functions as a sort of offset/label/pointer if you
will to the new fields that will will be extended to the record by simply
allocating more memory then the size of the record.

Then this label/field can be used as a sort of offset, by typecasting 
it

to some extension record type.

Could be pretty handy, quite impressive trick.

However, is it safe to use ?


Empty records are valid Pascal.


I cannot find anything in the documentation about this ?


Nothing in the documentation says it is forbidden either. The reason
it is not explicetely mentioned is because there exists a
much better method, objects:

type  base_structure=object
field1:byte;
  end;

  extended_structure=object(base_structure)
field2:byte;
  end;

Daniël






___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Empty record inside another record ?

2008-02-24 Thread Daniël Mantione



Op Sun, 24 Feb 2008, schreef Skybuck Flying:


Finally there is another question remaining:

Are objects always packed ?


No, to get packed objects you have to declare them packed. A record and 
object with the same field list have the same binary layout.


Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Vim FileType for pascal files

2008-02-24 Thread Damien Gerard


hi !

I use includes files and a vim editor. Obviously  .inc are not  
recognized as pascal files.

I tried the following :
// vim:ts=4:filetype=pascal

but it does not work.

Any ideas ?


--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Vim FileType for pascal files

2008-02-24 Thread bartek
On Sunday 24 February 2008 13:29:45 Damien Gerard wrote:
 
 hi !
 
 I use includes files and a vim editor. Obviously  .inc are not  
 recognized as pascal files.
 I tried the following :
 // vim:ts=4:filetype=pascal
 
 but it does not work.
 
 Any ideas ?
 
Hi, its nice to see another user of fpc+vim ;)

My way of detecting .inc and .pp:

% cat .vim/ftdetect/pp.vim
au BufRead,BufNewFile *.pp  set filetype=pascal
au BufRead,BufNewFile *.inc set filetype=pascal

An advantage is that you do not need to include // vim:ts=4:filetype=pascal at 
the beginning of each file.
By the way, your way of doing it should work, but the VIM newsgroup is IMHO a 
better place to ask such a question.

bartek
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Vim FileType for pascal files

2008-02-24 Thread Lucas Vasconcelos
hi,

try

// vim: set ts=4 filetype=pascal :

;~]

On Sun, Feb 24, 2008 at 9:29 AM, Damien Gerard [EMAIL PROTECTED] wrote:

  hi !

  I use includes files and a vim editor. Obviously  .inc are not
  recognized as pascal files.
  I tried the following :
  // vim:ts=4:filetype=pascal

  but it does not work.

  Any ideas ?


  --
  Damien Gerard
  [EMAIL PROTECTED]

  Le temps n'a pas d'importance. Seul le code est important
 -- (f00ty)




  ___
  fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
  http://lists.freepascal.org/mailman/listinfo/fpc-pascal




-- 
Lucas Vasconcelos
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Vim FileType for pascal files

2008-02-24 Thread Damien Gerard


Le Feb 24, 2008 à 9:59 PM, Lucas Vasconcelos a écrit :


hi,

try

// vim: set ts=4 filetype=pascal :

;~]



It does not work either :(

On Sun, Feb 24, 2008 at 9:29 AM, Damien Gerard  
[EMAIL PROTECTED] wrote:


hi !

I use includes files and a vim editor. Obviously  .inc are not
recognized as pascal files.
I tried the following :
// vim:ts=4:filetype=pascal




--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] ARM and graphic libraries

2008-02-24 Thread Paul Nicholls
- Original Message - 
From: Weyert de Boer [EMAIL PROTECTED]

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Saturday, February 23, 2008 9:40 AM
Subject: [fpc-pascal]  ARM and graphic libraries


Does anyone here have any experience with using FreePascal using ARM 
microprocessor and drawing graphics?

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


I have been using freepascal compiled programs on a arm-linux powered 
handheld called the GP2X.
I have been doing graphics using the JEDI-SDL units, and also with the raw 
frame buffer on the device.


http://fpc4gp2x.eonclash.com/
http://wiki.freepascal.org/GP2X

cheers,
Paul Nicholls 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal