[fpc-pascal] Looking for testers for 3.2.0 release cross-compilers for NDS, GBA and WII targets

2020-10-04 Thread Pierre Muller via fpc-pascal
  Hi everyone,

 I was wondering if there are still users of
Free Pascal compiler targeting arm-nds, arm-gba or powerpc-wii.

  I recently managed to re-generate 3.2.0 cross-install files
for i386-win32 (usable of Windows OSes)
target arm-gba, arm-nds and powerpc-wii.
  These zip files also include newly generated cross-binutils
using unmodified binutils 2.35 release.

  There are also cross-install files for x86_64-linux systems,
with binutils 2.34 (gba and wii) or 2.35 (nds).


 These files are not yet included in the download pages on the Free Pascal 
web-site,
but there can be fetched from:
ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/arm-nds/
ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/arm-gba/
and
ftp://ftp.freepascal.org/pub/fpc/dist/3.2.0/powerpc-wii/

  If someone who is still using Free Pascal for those targets
could try the new files out and report about their usability,
it would be great to get feedback!



  Pierre
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Looking for testers for 3.2.0 release cross-compilers for NDS, GBA and WII targets

2020-10-04 Thread code dz via fpc-pascal
2020-10-04 17:35 UTC+01:00, Pierre Muller via fpc-pascal
:
>   Hi everyone,
>
>  I was wondering if there are still users of
> Free Pascal compiler targeting arm-nds, arm-gba or powerpc-wii.
>

i had always the same question i my head , since these are very old
console devices
i will give it a try :)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Dynamic Arrays in Procedures

2020-10-04 Thread James Richters via fpc-pascal
I'm wondering if there is a way to pass an array of values to a Procedure
without defining an array variable.. 
 
For example, if I have a Procedure:
 
Procedure DoSomething(X :Byte);
 
Then I can call it with a specific a variable like this:
 
Var
   ThingA :Byte;
.
 
DoSomething(ThingA);  
 
And I can also call it without a variable but instead just hard code a
specific value like this:
 
DoSomething($1A);
 
 
So if I have a procedure like this:
 
Procedure DoSomethingElse(Y :Array of Byte);
 
I can call it like this:
Var
   ThingB :Array Of Byte;
 
SetLength(ThingB,3);
ThingB[0] :=$12;
ThingB[1] :=$1A;
ThingB[2] :=$2B;
DoSomethingElse(ThingB);
 
But can I also just call it with specific values somehow?
DoSomethingElse([$12,$1A,$2B]);   for example. of course this doesn't work,
but is there a syntax that would work?
 
James
 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Dynamic Arrays in Procedures

2020-10-04 Thread Howard Page-Clark via fpc-pascal

On 04/10/2020 20:58, James Richters via fpc-pascal wrote:


I’m wondering if there is a way to pass an array of values to a 
Procedure without defining an array variable….


For example, if I have a Procedure:

Procedure DoSomething(X :Byte);

Then I can call it with a specific a variable like this:

Var

ThingA :Byte;

…

DoSomething(ThingA);

And I can also call it without a variable but instead just hard code a 
specific value like this:


DoSomething($1A);

So if I have a procedure like this:

Procedure DoSomethingElse(Y :Array of Byte);

I can call it like this:

Var

ThingB :Array Of Byte;

SetLength(ThingB,3);

ThingB[0] :=$12;

ThingB[1] :=$1A;

ThingB[2] :=$2B;

DoSomethingElse(ThingB);

But can I also just call it with specific values somehow?

DoSomethingElse([$12,$1A,$2B]);for example… of course this doesn’t 
work, but is there a syntax that would work?




There is array of const syntax.

== code==

program project1;

{$mode objfpc}

procedure ShowArray(anArray: array of const);
var
  i: Integer;
begin
  for i := Low(anArray) to High(anArray) do
    case anArray[i].VType of
  vtInteger: WriteLn(anArray[i].VInteger,' ');
  vtChar: WriteLn(anArray[i].VChar,' ');
    end;
end;

begin
  ShowArray([99, -1, 'p', 'G']);
  ReadLn;
end.

== code end==



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Dynamic Arrays in Procedures

2020-10-04 Thread gabor via fpc-pascal

W dniu 2020-10-04 o 21:58, James Richters via fpc-pascal pisze:
DoSomethingElse([$12,$1A,$2B]);for example… of course this doesn’t work, 
but is there a syntax that would work?


This expression works fine with FPC 3.2.0
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Dynamic Arrays in Procedures

2020-10-04 Thread James Richters via fpc-pascal
So it does... 

I should have tested my own example.   I found my problem, I declared it as Var 
and it would only work with variables due to that.

-Original Message-
From: fpc-pascal  On Behalf Of gabor 
via fpc-pascal
Sent: Sunday, October 4, 2020 4:34 PM
To: fpc-pascal@lists.freepascal.org
Cc: gabor 
Subject: Re: [fpc-pascal] Dynamic Arrays in Procedures

W dniu 2020-10-04 o 21:58, James Richters via fpc-pascal pisze:
> DoSomethingElse([$12,$1A,$2B]);for example… of course this doesn’t 
> work, but is there a syntax that would work?

This expression works fine with FPC 3.2.0 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Dynamic Arrays in Procedures

2020-10-04 Thread Winfried Bartnick via fpc-pascal


Am 04.10.20 um 23:44 schrieb James Richters via fpc-pascal:

So it does...

I should have tested my own example.   I found my problem, I declared it as Var 
and it would only work with variables due to that.

-Original Message-
From: fpc-pascal  On Behalf Of gabor 
via fpc-pascal
Sent: Sunday, October 4, 2020 4:34 PM
To: fpc-pascal@lists.freepascal.org
Cc: gabor 
Subject: Re: [fpc-pascal] Dynamic Arrays in Procedures

W dniu 2020-10-04 o 21:58, James Richters via fpc-pascal pisze:

DoSomethingElse([$12,$1A,$2B]);for example… of course this doesn’t
work, but is there a syntax that would work?

This expression works fine with FPC 3.2.0 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Hi!

Works also  fine with fpc  3.04

Winni


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Dynamic Arrays in Procedures

2020-10-04 Thread Sven Barth via fpc-pascal
James Richters via fpc-pascal  schrieb am
So., 4. Okt. 2020, 23:44:

> So it does...
>
> I should have tested my own example.   I found my problem, I declared it
> as Var and it would only work with variables due to that
>

That's just a normal open array parameter and worked this way for a long
time already.

What's new in 3.2.0 is that you can use dynamic array parameters together
with array constructors as well.

Important: if you have "array of xxx" directly inside a parameter clause
that ja *always* an open array. For a dynamic array you need to explicitly
declare an array type or use an inline specialization of TArray<>.

Regards,
Sven

>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal