Re: [fpc-pascal] More Filter Madness

2011-10-13 Thread Vincent Snijders
2011/10/14 Ko Hashiguchi : > Mine is more of a programming problem, rather than one native to Pascal, but > here goes: > > I have a text file with many Double values. Looking more or less like below, > but with hundreds of entries... > > 1.5 > 3.25 > 7.54 > 10.33 > 2.22 > > The values listed are on

Re: [fpc-pascal] More Filter Madness

2011-10-13 Thread Nataraj S Narayan
Hi Good candidate for recursive algorithm i think. regards Nataraj On Fri, Oct 14, 2011 at 6:23 AM, Ko Hashiguchi wrote: > Mine is more of a programming problem, rather than one native to Pascal, but > here goes: > > I have a text file with many Double values. Looking more or less like below,

[fpc-pascal] More Filter Madness

2011-10-13 Thread Ko Hashiguchi
Mine is more of a *programming *problem, rather than one native to Pascal, but here goes: I have a text file with many Double values. Looking more or less like below, but with hundreds of entries... 1.5 3.25 7.54 10.33 2.22 The values listed are only for illustration. What I need to do is read t

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Jürgen Hestermann
Andrew Pennebaker schrieb: > In some languages, especially scripting languages, units can serve dual purposes. They can act as both a library and a self-sufficient program. RosettaCode describes this behavior as scripted main. If it's possible to compile a Pascal unit such that it executes in

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Ralf A. Quint
At 10:06 PM 10/13/2011, Søren Ager wrote: On 2011-10-14 05:17, Andrew Pennebaker wrote: In some languages, especially scripting languages, Pascal is not a scripted language so it is not really something you want (or should imo) to do in Pascal +1 Ralf __

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Jürgen Hestermann
Andrew Pennebaker schrieb: > I understand that units are designed to be reusable code / libraries / APIs. It's a practical way to organize code, and a pretty good name for it, too. In Pascal, units can have optional "initialization" and "finalization" code (syntax as shown in the link by J

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Søren Ager
On 2011-10-14 05:17, Andrew Pennebaker wrote: In some languages, especially scripting languages, Pascal is not a scripted language so it is not really something you want (or should imo) to do in Pascal Let's say I want to write a dual-purpose Fibonacci program, fib.p. It should: Then you

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Andrew Pennebaker
I understand that units are designed to be reusable code / libraries / APIs. It's a practical way to organize code, and a pretty good name for it, too. In some languages, especially scripting languages, units can serve dual purposes. They can act as both a library and a self-sufficient program. Ro

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Ralf A. Quint
At 08:02 PM 10/13/2011, Andrew Pennebaker wrote: I can USE the code just fine in a second file, test.p, and compile and run a test executable. But I'd like to be able to turn my units into self-sufficient executables (and later add command line options). Looks like you do not understand the b

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Andrew Pennebaker
I do know how to compile a basic Pascal program: $ cat hello.p program Hello; begin writeln('Hello World!') end. $ fpc hello.p $ ./hello Hello World! The problem I'm trying to solve is that it appears Pascal can't build executables from units, that is units by themselves. $ cat scriptedmain.p

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Jonas Maebe
On 13 Oct 2011, at 22:32, Andrew Pennebaker wrote: > On Thu, Oct 13, 2011 at 3:40 PM, Jonas Maebe wrote: > >> On 13 Oct 2011, at 21:37, Andrew Pennebaker wrote: >> >>> Is it possible to have a begin/end declaration in a unit a la C's main >>> function? I would like my units to double as librari

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Andrew Pennebaker
Hmm. I tried rewriting begin/end as initialization/end, but scriptedmain.p still won't compile to an executable. fpc just creates a .PPU file. scriptedmain.p https://github.com/mcandre/scriptedmain/tree/master/pascal Cheers, Andrew Pennebaker www.yellosoft.us On Thu, Oct 13, 2011 at 3:40 PM, Jo

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Jonas Maebe
On 13 Oct 2011, at 21:37, Andrew Pennebaker wrote: > Is it possible to have a begin/end declaration in a unit a la C's main > function? I would like my units to double as libraries and executables. Yes: http://www.freepascal.org/docs-html/ref/refse72.html Jonas

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Andrew Pennebaker
Is it possible to have a begin/end declaration in a unit a la C's main function? I would like my units to double as libraries and executables. In other words, I'd like to be able to do scriptedmainin Pascal. Cheers, Andrew Pennebaker www.yellosoft

Re: [fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Jonas Maebe
On 13 Oct 2011, at 20:36, Andrew Pennebaker wrote: > If I were using C, I would type: > > #include "code.h" > > If I were using Python, I would type: > > import code > > What's the command to load code in Pascal? http://www.learn-programming.za.net/programming_pascal_learn12.html Jonas __

[fpc-pascal] How do I load external Pascal code?

2011-10-13 Thread Andrew Pennebaker
If I were using C, I would type: #include "code.h" If I were using Python, I would type: import code What's the command to load code in Pascal? And where do the load commands go? Before variables? After? Within? Cheers, Andrew Pennebaker www.yellosoft.us _

Re: [fpc-pascal] Stunnel replaced by FPC?

2011-10-13 Thread Reinier Olislagers
On 13-10-2011 14:22, Wimpie Nortje wrote: > Have a look at BEEP (beepcore.org) and Vortex (www.aspl.es/vortex). I > think it covers all of your requirements. Thanks, I'll have a look. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://li

Re: [fpc-pascal] Stunnel replaced by FPC?

2011-10-13 Thread Wimpie Nortje
Have a look at BEEP (beepcore.org) and Vortex (www.aspl.es/vortex). I think it covers all of your requirements. Currently the closest to a Pascal version is BeepFp, which uses Vortex. BeepFp is however not finished yet, so it may or may not work for you. On 2011/10/13 01:15 PM, Reinier Olislagers

[fpc-pascal] Stunnel replaced by FPC?

2011-10-13 Thread Reinier Olislagers
Hi list, For my remote assistance screen sharing project https://bitbucket.org/reiniero/checkride/ I'm currently using stunnel on Windows to tunnel VNC traffic over an SSL/TLS tunnel. Can I replace stunnel with e.g. Synapse code? The Synapse documentation only shows https examples. I'd like to t

Re: [fpc-pascal] FPC 2.4.4 - Error: Illegal type conversion: "Set of TMySet" to "Byte" ... and vice versa

2011-10-13 Thread Jonas Maebe
On 13 Oct 2011, at 11:42, fred f wrote: I am trying to compile my code which is compatible with Delphi and FPC 2.5.1+, but when I try to compile on Mac OS X with 2.4.4 I have error message: Error: Illegal type conversion: "Set of TMyEnum" to "Byte" It works in FPC 2.5.1+ because of this chan

[fpc-pascal] FPC 2.4.4 - Error: Illegal type conversion: "Set of TMySet" to "Byte" ... and vice versa

2011-10-13 Thread fred f
Hi guys, I am trying to compile my code which is compatible with Delphi and FPC 2.5.1+, but when I try to compile on Mac OS X with 2.4.4 I have error message: Error: Illegal type conversion: "Set of TMyEnum" to "Byte" and Error: Illegal type conversion: "Byte" to "Set of TMyEnum" The code is f