On Wed, 05 Apr 2023 00:33:50 +0200, Bo Berglund via fpc-pascal
wrote:
>On Tue, 4 Apr 2023 23:43:21 +0200, Christo Crause via fpc-pascal
> wrote:
>
>
>>Is your startaddress variable an unsigned 16 bit integer
>>(word/uint16)? If not, type cast this to a uint16 to ensure the compiler
>>calls the co
On Tue, 4 Apr 2023 23:43:21 +0200, Christo Crause via fpc-pascal
wrote:
>> if not i2cMaster.WriteBytesToReg(FEEPROMAddr, startaddress, @source[0],
>> NumBytes) then
>>
>> Here the source argument is a TBytes array of bytes so I supply the
>> address of
>> element 0 as the data argument (expected
Travis Siegel via fpc-pascal schrieb am
Di., 4. Apr. 2023, 20:34:
> I'm not positive, because I've never used them, but I'm pretty sure
> variables configured as const, can't be changed once they're defined.
For typed constants that depends on the $WritableConsts directive.
Regards,
Sven
_
See comments below.
On Tue, Apr 4, 2023 at 6:52 PM Bo Berglund via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:
> I use the method:
>
> i2cMaster.WriteBytesToReg(i2caddress: byte; regAddress: uint16; data:
> PByte;
> size: byte): boolean;)
>
> With data specified as follows in the call:
>
On 04/04/2023 16:14, Bart via fpc-pascal wrote:
If your local "writeable constant" is of type string, and strings are
longstrings, and the writeable const is assigned a value that is the
result of a string concatenation, then you'll have a memory leak.
That does not matter in practice (*), sinc
Didn't know that either:
"It should be stressed that typed constants are automatically initialized at
program start. This is also true for local typed constants and initialized
variables. Local typed constants are also initialized at program start. If
their value was changed during previous inv
>
> Page Write ...
>
What this means is that if you start in the middle of a 64 byte block,
let's say at byte 60 (0 based) which is on page 0, and you write 4 bytes,
then you will write into 60, 61, 62 and 63 as expected. But if you write 6
bytes, you will write into bytes 60, 61, 62, 63 and then
I'm not positive, because I've never used them, but I'm pretty sure
variables configured as const, can't be changed once they're defined.
If that's your intent, then feel free to use them, but it sounds like
you're trying to make variables (not constant values) last for the whole
program, with
On Sun, 02 Apr 2023 23:21:38 +0200, Bo Berglund via fpc-pascal
wrote:
>On Sun, 2 Apr 2023 23:14:25 +0200, Christo Crause via fpc-pascal
> wrote:
>
>>On Sun, Apr 2, 2023 at 9:30?PM Bo Berglund via fpc-pascal <
>>fpc-pascal@lists.freepascal.org> wrote:
>>
>>> Is there a reason that there is no i2c_
On Tue, Apr 4, 2023 at 6:00 PM Tomas Hajny via fpc-pascal
wrote:
> Well, managed types are not very likely in code imported from a Pascal
> compiler not knowing units...
Well, his fpc.cfg might define string to be ansistring...
--
Bart
___
fpc-pascal
On 2023-04-04 16:14, Bart via fpc-pascal wrote:
On Tue, Apr 4, 2023 at 9:43 AM Jacob Kroon via fpc-pascal
wrote:
What is the technical downside to using "const", or is it just
cosmetic ?
If your local "writeable constant" is of type string, and strings are
longstrings, and the writeable cons
On Tue, Apr 4, 2023 at 9:43 AM Jacob Kroon via fpc-pascal
wrote:
> What is the technical downside to using "const", or is it just cosmetic ?
If your local "writeable constant" is of type string, and strings are
longstrings, and the writeable const is assigned a value that is the
result of a stri
On 2023-04-04 11:14, Sven Barth wrote:
Tomas Hajny via fpc-pascal schrieb
am Di., 4. Apr. 2023, 09:51:
.
.
If you read the documentation (wiki or the real documentation in
PDF/HTML etc.) properly, you don't find there anything saying that
constants declared locally within functions or proce
Tomas Hajny via fpc-pascal schrieb am
Di., 4. Apr. 2023, 09:51:
> On 2023-04-04 09:43, Jacob Kroon wrote:
>
>
> Hi Jacob,
>
> >> You don't need to change "var" to "const" - if you want to ensure the
> >> variables to persist in between the function/procedure runs, you need
> >> to move them to th
Hi Tomas,
On 4/4/23 09:51, Tomas Hajny wrote:
On 2023-04-04 09:43, Jacob Kroon wrote:
Hi Jacob,
You don't need to change "var" to "const" - if you want to ensure the
variables to persist in between the function/procedure runs, you need
to move them to the global level, i.e. outside of the
On 2023-04-04 09:43, Jacob Kroon wrote:
Hi Jacob,
You don't need to change "var" to "const" - if you want to ensure the
variables to persist in between the function/procedure runs, you need
to move them to the global level, i.e. outside of the
functions/procedures. It is not advisable as a g
Hi Michael,
On 4/4/23 09:05, Michael Van Canneyt wrote:
[cut]
Do I have any other option besides changing from "var" to "const"
everywhere, and provide initial values in all declarations ?
Make them actually global variables.
procedure X;
Var
y : integer;
begin
// Use y
end;
becomes
Hi Tomas,
On 4/4/23 09:01, Tomas Hajny via fpc-pascal wrote:
[cut]
You don't need to change "var" to "const" - if you want to ensure the
variables to persist in between the function/procedure runs, you need to
move them to the global level, i.e. outside of the functions/procedures.
It is not
Hi Bernd,
On 4/4/23 08:54, Bernd Oppolzer via fpc-pascal wrote:
Am 04.04.2023 um 08:16 schrieb Jacob Kroon via fpc-pascal:
Thanks for the tip above.
I was able to write a couple of perl-scripts that are able to convert
my old Pascal sources to something that fpc can parse. Amongst other
thi
On Tue, 4 Apr 2023, Jacob Kroon via fpc-pascal wrote:
Hi Charlie, everyone,
On 3/28/23 11:33, Karoly Balogh wrote:
[cut]
If you want to export a variable without name mangling, you must declare a
public name for it, something like:
var
foobar: integer; public name '_myfoobar';
Then
Am 04.04.2023 um 08:16 schrieb Jacob Kroon via fpc-pascal:
Thanks for the tip above.
I was able to write a couple of perl-scripts that are able to convert
my old Pascal sources to something that fpc can parse. Amongst other
things, the scripts inject the "public name"/"external name"
annotat
On 2023-04-04 08:16, Jacob Kroon via fpc-pascal wrote:
Hi Jacob,
.
.
But I suspect I have a new problem: With the old Pascal/MT+ compiler
it would appear that local variables declared in functions/procedures
have a life-time that spans the whole program, like a "static"
declared variable in
22 matches
Mail list logo