Re: [fpc-pascal] Convert to int64 note

2017-07-14 Thread Ewald
On 14/07/17 17:19, ja...@productionautomation.net wrote: >> If you declare Last_GS as int64, you should not get the warning. > > I declared both Last_GS and G_End as int64, leaving Max_Program_to_Display as > a word and still get the warning. If I also make Max_Program_to_Display > int64, then

Re: [fpc-pascal] Convert to int64 note

2017-07-14 Thread Reimar Grabowski
On Fri, 14 Jul 2017 17:58:16 +0200 Mattias Gaertner wrote: > longint is type. longint() is a typecast. Thx, now you ruined my amazingly funny response which would have delighted the list members for the whole weekend perhaps even up to the middle of next week. It was

Re: [fpc-pascal] Convert to int64 note

2017-07-14 Thread Mattias Gaertner
On Fri, 14 Jul 2017 11:19:53 -0400 wrote: >[...] > >Last_GS:=G_End-(longint(Max_Program_To_Display)-1); > This aso fixes the warning if I leave all my variables alone. If I > understand this correctly in this case longint() is a function that returns a >

Re: [fpc-pascal] Convert to int64 note

2017-07-14 Thread james
>If you declare Last_GS as int64, you should not get the warning. I declared both Last_GS and G_End as int64, leaving Max_Program_to_Display as a word and still get the warning. If I also make Max_Program_to_Display int64, then I do not get the warning. I believe it's due to the -1. If

Re: [fpc-pascal] Convert to int64 note

2017-07-14 Thread Mattias Gaertner
On Fri, 14 Jul 2017 08:04:51 -0400 wrote: > >What's the type of each variable? > > Last_GS,G_End : longint; > Max_Program_to_Display : Word; Last_GS:=G_End-(longint(Max_Program_To_Display)-1); Mattias ___ fpc-pascal

Re: [fpc-pascal] Convert to int64 note

2017-07-14 Thread james
>What's the type of each variable? Last_GS,G_End : longint; Max_Program_to_Display : Word; -Original Message- From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of Santiago A. Sent: Friday, July 14, 2017 7:00 AM To: fpc-pascal@lists.freepascal.org Subject: Re:

Re: [fpc-pascal] Convert to int64 note

2017-07-14 Thread Santiago A.
El 14/07/2017 a las 1:13, ja...@productionautomation.net escribió: > I've been trying to get my programs to compile without any warnings or notes, > but I keep getting this one: > > promill.pas(2137,42) Hint: Converting the operands to "Int64" before doing > the subtract could prevent overflow

Re: [fpc-pascal] Delete and Add for TBytes?

2017-07-14 Thread Michael Schnell
On 12.07.2017 16:07, Bo Berglund wrote: I would like to instead use TBytes as container As a dynamic array (TBytes) does not support lazy copy, this might introduce some performance and other trouble. AFAIK, FPC's ANSISTring should not introduce any (Unicode) translations as long as you use