Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-22 Thread Marc Santhoff
On Sa, 2016-07-23 at 05:55 +0200, Marc Santhoff wrote: > On Fr, 2016-07-22 at 18:20 -0400, James Richters wrote: > > I'm trying to avoid custom hardware if possible. I have always used > > parallel ports and never had a problem with them until now. I like the > > idea of a parallel port because

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-22 Thread Marc Santhoff
On Fr, 2016-07-22 at 18:20 -0400, James Richters wrote: > I'm trying to avoid custom hardware if possible. I have always used > parallel ports and never had a problem with them until now. I like the > idea of a parallel port because they are still built onto motherboards, and > there are also a

Re: [fpc-pascal] Linux Port help

2016-07-22 Thread Graeme Geldenhuys
On 2016-07-23 01:15, James Richters wrote: > forgetting that linux is extremely case sensitive with everything.. I saved > one with a .pas extention, closed it then opened it and now that one file > has the highlight, the others do not.. easy enough to fix that though. You can also tell Text IDE

Re: [fpc-pascal] Linux Port help

2016-07-22 Thread James Richters
I checked and syntax highlight was already checked.. I did figure it out though.. all my pascal files were named with a .PAS extension and I keep forgetting that linux is extremely case sensitive with everything.. I saved one with a .pas extention, closed it then opened it and now that one file

Re: [fpc-pascal] Linux Port help

2016-07-22 Thread Graeme Geldenhuys
On 2016-07-22 23:33, James Richters wrote: > Here are screenshots: > https://github.com/Zaaphod/FPC-Parallel-Port/issues/1 I just checked. My FreeBSD version looks like the Windows screenshot. Also under Linux, load the IDE, then go to Options -> Environment -> Editor. Then under "Editor

Re: [fpc-pascal] Linux Port help

2016-07-22 Thread James Richters
Yes, they are both 1.0.12 included with fpc 3.0.0 Here are screenshots: https://github.com/Zaaphod/FPC-Parallel-Port/issues/1 I like the text ide because I understand it, it's pretty much like the Turbo Pascal ide. I tried installing lazerus and I cannot even compile my program with that...

Re: [fpc-pascal] Vehicle Routing Problem with Time Windows

2016-07-22 Thread Amir
As you might know, the VRP and many of its variants are NP-Complete problems. So one could solve an instance of these problems by generating an ILP instance(https://en.wikipedia.org/wiki/Vehicle_routing_problem). There are many academic publications about how to find a sub-optimal solution

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Bart
On 7/22/16, Jonas Maebe wrote: >> ResultA := AnsiToUTF8(AnsiStrA + AnsiStrA); // UTF-8 ResultB := >> AnsiToUTF8(AnsiStrA) + AnsiToUTF8(AnsiStrA); // Win-1252 >> >> >> And resultA is not equal to ResultB >> >> It doesn't look like too intuitive. > > It would be

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-22 Thread James Richters
I'm trying to avoid custom hardware if possible. I have always used parallel ports and never had a problem with them until now. I like the idea of a parallel port because they are still built onto motherboards, and there are also a TON of USB to parallel port adapters out there. I'm trying to

Re: [fpc-pascal] Linux Port help

2016-07-22 Thread Graeme Geldenhuys
On 2016-07-22 21:38, James Richters wrote: > Linux is just all yellow on light blue. The windows > one for example will show comments in grey reserved words in white.. ect.. > it makes it a lot easier to follow Are they the same versions of the IDE? I don't really use the Text IDE, but I can

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-22 Thread Mark Morgan Lloyd
James Richters wrote: I was rather rushed earlier for reasons that would probably amuse but would be vastly OT (shoving sheep around Sussex since we're shearing Saturday...). I like the looks of that Velleman K8055, that would do the job for me if I can get it to work. I would actually

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Jonas Maebe
On 22/07/16 21:49, Santiago A. wrote: El 22/07/2016 a las 17:56, Jonas Maebe escribió: There is no hidden secret knowledge. Everything is documented and the information is linked from the release notes. The "principle of least surprise" has been applied in the sense that we didn't invent our

Re: [fpc-pascal] Linux Port help

2016-07-22 Thread James Richters
Thank you for the F11 suggestion.. F11 does make the IDE window full screen, Thanks!! That's very helpful. My program however does not respond to F11. There is no way to resize the window, make it larger or smaller or full screen, it's just a fixed size window.. this is the version using ptcgraph

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Graeme Geldenhuys
On 2016-07-22 20:49, Santiago A. wrote: > In addition, changing the codepage on the fly if a bad idea. +1 I think that is very much the wrong behaviour too. As I mentioned before is this mailing list. I think the FPC 3.x with these codepage aware AnsiStrings is a damn mess. As far as I can see,

Re: [fpc-pascal] Linux Port help

2016-07-22 Thread Graeme Geldenhuys
On 2016-07-22 20:59, James Richters wrote: > 4. not full screen. For some reason I can't get it to be full screen in > linux at all.. Press F11. That is a almost universal shortcut for any X11 desktop environment and Window Manager to switch the active program to full screen. If you are running

[fpc-pascal] Linux Port help

2016-07-22 Thread James Richters
I'm a newbie trying to port an old turbo pascal program to FreePascal in linux. My reasons for doing this is old Pentium 233 motherboards are getting harder to keep running and I need be running on more modern hardware.. It's a massive program and I just don't have time to re-write the whole

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Santiago A.
El 22/07/2016 a las 17:56, Jonas Maebe escribió: > > There is no hidden secret knowledge. Everything is documented and the > information is linked from the release notes. The "principle of least > surprise" has been applied in the sense that we didn't invent our own > system that introduces small

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-22 Thread James Richters
I like the looks of that Velleman K8055, that would do the job for me if I can get it to work. I would actually prefer a linux port of my program however I keep hitting a roadblock when I try to use the graph unit. My program used the turbo pascal graph unit exclusively for it's user interface

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-22 Thread James Richters
Thank you! I was indeed trying to use the 64bit DLL.. I mistakenly thought you were supposed to use the version of the operating system, not the program. I have absolutely zero experience with windows programs. I am able to run my program now, but still not working exactly as I want it to

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Jonas Maebe
On 22/07/16 17:33, Santiago A. wrote: So ResultA := AnsiToUTF8(AnsiStrA + AnsiStrA); // UTF-8 ResultB := AnsiToUTF8(AnsiStrA) + AnsiToUTF8(AnsiStrA); // Win-1252 And resultA is not equal to ResultB It doesn't look like too intuitive. It would be good if someone with access to Delphi

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Santiago A.
El 22/07/2016 a las 15:03, Jonas Maebe escribió: > > See again > http://wiki.freepascal.org/FPC_Unicode_support#String_concatenations > (same as before). So ResultA := AnsiToUTF8(AnsiStrA + AnsiStrA); // UTF-8 ResultB := AnsiToUTF8(AnsiStrA) + AnsiToUTF8(AnsiStrA); // Win-1252 And

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-22 Thread Marc Santhoff
On Do, 2016-07-21 at 05:29 +0200, Marc Santhoff wrote: > On Fr, 2016-07-15 at 14:59 -0700, Zaaphod wrote: > > I am trying to get access to the parallel port with Free Pascal. > > > > I'm trying to use this version of inpout32 (x64) > > http://www.highrez.co.uk/downloads/inpout32/ > > > >

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-22 Thread Mark Morgan Lloyd
James Richters wrote: What I need to do is be able to read some 5v TTL Inputs in and write some 5v TTL outputs out. The parallel port always worked when my program was a DOS program.. it was so simple, just do Port[$378]:= data to set the bits on the port or data:=port[$378] to read some bits

Re: [fpc-pascal] FPC allows modifying loop variable

2016-07-22 Thread Graeme Geldenhuys
On 2016-07-22 14:04, Jonas Maebe wrote: > FPC has no interprocedural dataflow analysis that could catch something > like that. I just tested with Delphi 7, and FPC is Delphi compatible. ;-) D7 doesn't seem to have inter-procedural dataflow analysis either. Regards, Graeme

Re: [fpc-pascal] Parallel Port Access with Free Pascal - windows

2016-07-22 Thread James Richters
What I need to do is be able to read some 5v TTL Inputs in and write some 5v TTL outputs out. The parallel port always worked when my program was a DOS program.. it was so simple, just do Port[$378]:= data to set the bits on the port or data:=port[$378] to read some bits from the port. I'm not

[fpc-pascal] Vehicle Routing Problem with Time Windows

2016-07-22 Thread Dimitrios Chr. Ioannidis
Hi, does anyone knows any object pascal or c ( not c++, java, lisp ... ) library that can solve the Vehicle Routing Problem with Time Windows, open source or not ? Searched but couldn't find any ... regards, -- Dimitrios Chr. Ioannidis ___

Re: [fpc-pascal] FPC allows modifying loop variable

2016-07-22 Thread Jonas Maebe
On 22/07/16 14:49, Graeme Geldenhuys wrote: I just discovered a surprising bug in my application. I had a variable "b" defined which I used in a FOR loop. FPC forbids you to modify that loop variable inside the for loop - which is understandable. However, the loop called a local procedure, and

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Jonas Maebe
On 22/07/16 14:14, Santiago A. wrote: program testconvertstr; You are missing {$h+} here. When posting programs, always include all switches and/or all command line options. The program also compiles with string = shortstring (the default), but has different behaviour in that case. var

Re: [fpc-pascal] FPC allows modifying loop variable

2016-07-22 Thread Graeme Geldenhuys
On 2016-07-22 13:49, Graeme Geldenhuys wrote: > However, the loop called a local procedure, and that local procedure > modified the loop variable. FPC never complained about it. Is this a FPC > bug? I forgot to mention, I used FPC 2.6.4. Regards, Graeme

[fpc-pascal] FPC allows modifying loop variable

2016-07-22 Thread Graeme Geldenhuys
Hi, I just discovered a surprising bug in my application. I had a variable "b" defined which I used in a FOR loop. FPC forbids you to modify that loop variable inside the for loop - which is understandable. However, the loop called a local procedure, and that local procedure modified the loop

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Graeme Geldenhuys
On 2016-07-22 13:14, Santiago A. wrote: > I'm definitively completely lost :) So am I. Regards, Graeme ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Santiago A.
El 22/07/2016 a las 12:55, Bart escribió: > Just check the vaue of StringCodePage(Utf8StrA). Not Initialized AnsiStrA: 1252 ResultA: 1252 AnsiStrA:=' ' AnsiStrA: 0 AnsiStrA[1]:=#243; // o acute win-1252 AnsiStrA: 0 ResultA:=AnsiStrA ResultA: 0 ResultA := AnsiStrA + ' ' ResultA:

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: On Fri, 22 Jul 2016, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: Or better yet, the official documentation: http://www.freepascal.org/docs-html/current/rtl/system/default.html Question please. Using the official documentation as linked to above, how

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Graeme Geldenhuys
On 2016-07-22 11:55, Bart wrote: > Gives: > StringCodePage(AnsiStrA) now is: 65001 > AnsiStrA: 195 179 I don't understand, why did AnsiStrA change its codepage type after the 3rd assignment to it? Here is the results on my Windows 7 system. == $

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Bart
On 7/22/16, Santiago A. wrote: > // is Utf8StrA now utf8string? or something similar like Ansistring(UTF_8) > // is Utf8StrB now utf8string? or something similar like Ansistring(UTF_8) Just check the vaue of StringCodePage(Utf8StrA). procedure

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Bo Berglund
On Fri, 22 Jul 2016 08:12:01 +0200, Bo Berglund wrote: >>you need to assign it a value, you can assign it default(yourtype) >> > >Is "default" zero? >i.e. > >var > HD: TSSReadingHeader; > .. >begin > HD := Default(TSSReadingHeader); > >And now HD.anything is zero? I

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Michael Van Canneyt
On Fri, 22 Jul 2016, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: Or better yet, the official documentation: http://www.freepascal.org/docs-html/current/rtl/system/default.html Question please. Using the official documentation as linked to above, how does one find out what

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: Or better yet, the official documentation: http://www.freepascal.org/docs-html/current/rtl/system/default.html Question please. Using the official documentation as linked to above, how does one find out what versions of the compiler/rtl/fcl support something?

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Michael Van Canneyt
On Fri, 22 Jul 2016, Mattias Gaertner wrote: On Fri, 22 Jul 2016 11:03:23 +0200 (CEST) Michael Van Canneyt wrote: On Fri, 22 Jul 2016, leledumbo wrote: OK, I did not know about the default keyword. Is "default" zero?

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Mattias Gaertner
On Fri, 22 Jul 2016 11:03:23 +0200 (CEST) Michael Van Canneyt wrote: > On Fri, 22 Jul 2016, leledumbo wrote: > > >> OK, I did not know about the default keyword. > >> > >> Is "default" zero? > > > >

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Michael Van Canneyt
On Fri, 22 Jul 2016, leledumbo wrote: OK, I did not know about the default keyword. Is "default" zero? http://wiki.lazarus.freepascal.org/FPC_New_Features_3.0#New_compiler_intrinsic_Default Or better yet, the official documentation:

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread leledumbo
> OK, I did not know about the default keyword. > > Is "default" zero? http://wiki.lazarus.freepascal.org/FPC_New_Features_3.0#New_compiler_intrinsic_Default -- View this message in context:

Re: [fpc-pascal] Weird string behavior

2016-07-22 Thread Santiago A.
El 22/07/2016 a las 0:32, Bart escribió: > On 7/21/16, Santiago A. wrote: > >> I've come across this issue: When I concatenate two strings in UTF8 they >> are converted to ansi (Win-1252) . > You have declared all string variables as plain "string", which is the > same as

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Bo Berglund
On Mon, 18 Jul 2016 23:30:47 +0200 (CEST), Michael Van Canneyt wrote: >> Are there other commands it does detect as initialization of the >> variable? > >not that I know of. > >you need to assign it a value, you can assign it default(yourtype) > OK, I did not know about