Re: [fpc-pascal] Convert to int64 note

2017-07-15 Thread Santiago A.
El 14/07/2017 a las 17:19, ja...@productionautomation.net escribió: >> 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 >

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
Re: [fpc-pascal] Convert to int64 note 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 "

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

[fpc-pascal] Convert to int64 note

2017-07-13 Thread james
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 errors. I get it a lot, but this is the line the above example is from: