Re: [fpc-pascal] child units (was: dot within unit file name)
On Jan 21, 2008 12:05 PM, John Stoneham <[EMAIL PROTECTED]> wrote: > On Jan 21, 2008 1:05 AM, Vinzent Hoefler <[EMAIL PROTECTED]> wrote: > > On Friday 18 January 2008 20:12, John Stoneham wrote: > > Perhaps that's true with regard to name resolution, but Ada's package > system has a significant feature which Pascal's module system lacks: > child packages. Conceptually, a child package is the same thing as a > nested package: > > package Parent is > ... >package Child is >... >end Child; > ... > end Parent; this looks exactly like Java inner classes. > > Now, the nested "Child" can be referenced outside "Parent" as > "Parent.Child". java : org.freepascal.example.OuterClass.InnerClass defined in a file called "OuterClass.java" > This has much more to offer than simply another level > (sometimes very necessary) of organization to a complex program. yes. among other things, in the java world, it makes for a great way to be able to encapsulate and control dependent objects that belong to the implementation that encapsulates them. data structure like classes for example that really don't have any business outside of the parent class. and even if those child classes are intended to escape out of the parent class via a return type, it still keeps the namespace and file system much cleaner, again, where the child has no other general use in the application. > For > example, the private part of a child package has access to it's > parent's private members as well. The visibility rules are similar to > those that relate to inheritance (via private, protected, and public > sections). This adds a level of encapsulation that is very desirable > in a complex program. yes, this sounds identical to how java does this as well. FWIW. Tony -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Notice: Possible copyright infringements in FPCcodebase
On Nov 21, 2007 7:07 AM, Skybuck Flying <[EMAIL PROTECTED]> wrote: > > > But it's not open source. > > I like to think of open source vs closed source as: Viewable / Non-Viewable. ... and _that_ is where you are going wrong. "open source" is a licensing term in these contexts. By making source code viewable does not grant one a license to copy it, in the same way that you can't photo copy and distribute a book. An amazing number of people seem to be highly confused by this. This is probably why projects like FreePascal get sideswiped by tainted code on a too frequent basis. Tony -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Sockets Unit Demos - RTL Manual Pg 1056
On 3/4/07, Jason P Sage <[EMAIL PROTECTED]> wrote: If not Accept(S, FromName,Sin,Sout ) Then The compiler complained about the data type for FromName. if no one jumps in with the exact answer, i would suggest that you might get better answers from the list if you : a) post a complete, but minimal example of source that demonstrates the problem. b) post the *exact* errors you get when you compile it. Jason P Sage Tony -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Blackberry
On 7/5/06, Michael Preslar <[EMAIL PROTECTED]> wrote: But rewriting in Java bytecode for Blackberry scares me. Gameport has made it very clear that the source cant be distributed in any form.. I know there are java decompilers for PCs.. I'd be there are ones for Blackberry as well. compiled java source (.class files) aren't "platform specific", though they may be JVM version (1.1, 1.2 ...) specific. so, a decompiler, available on any given platform, can decompile .class files for any device or platform. a couple of comments : *) some people use obfuscators for compiling their java code. these work by preprocessing your source code into equivalent source code, but with your symbols changed to consistent but "human meaningless" values. the theory goes that this makes decompiled .class files, generated from obfuscated source, very difficult to read/understand. *) is obfuscated, decompiled java source comparable to dissasembled binaries ? i suspect in practice, that the level of dedication required to reverse engineer either is about the same, assuming the individual has the skills and expertise for either. Which makes me lean towards WinCE that much more. because you think it will be harder to reverse engineer and "steal" your "door game" software ? a strange line of thinking if you ask me ... Tony -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Nice website
On 6/27/06, Mattias Gaertner <[EMAIL PROTECTED]> wrote: :) Mattias i love it ! great job to those involved ! Tony -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] exiting a program more friendly way
please trim your posts. thanks, Tony On 6/23/06, Pianoman <[EMAIL PROTECTED]> wrote: Hi, I'd like to ask whether is it possible to exit program in case of runtime error 202 for example more nicely than with message runtime error 202 at a1d456d5621blablabla For example: writeln('starting to divide:'); writeln(2/0); and I don't want mi program to stop with runtime error but I 'd like to write to screen something like: writeln('program has atempted to divide by zero enter another expression.'); old tp had a special procedure exitproc which allowed to set which code should be executed before terminating in case of run-time error. I mean code which will close opened files or something like that or it could write to logfile the reason of error. Thanx in advance Pianoman ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Modify XML Document
On 6/22/06, Felipe Monteiro de Carvalho <[EMAIL PROTECTED]> wrote: -- snip TDOCDocument interface source from FPC 2.0.2 -- TDOMDocument = class(TDOMNode_WithChildren) protected FDocType: TDOMDocumentType; FImplementation: TDOMImplementation; function GetDocumentElement: TDOMElement; public property DocType: TDOMDocumentType read FDocType; property Impl: TDOMImplementation read FImplementation; property DocumentElement: TDOMElement read GetDocumentElement; function CreateElement(const tagName: DOMString): TDOMElement; virtual; function CreateDocumentFragment: TDOMDocumentFragment; function CreateTextNode(const data: DOMString): TDOMText; function CreateComment(const data: DOMString): TDOMComment; function CreateCDATASection(const data: DOMString): TDOMCDATASection; virtual; function CreateProcessingInstruction(const target, data: DOMString): TDOMProcessingInstruction; virtual; function CreateAttribute(const name: DOMString): TDOMAttr; virtual; function CreateEntityReference(const name: DOMString): TDOMEntityReference; virtual; // Free NodeList with TDOMNodeList.Release! function GetElementsByTagName(const tagname: DOMString): TDOMNodeList; // Extensions to DOM interface: constructor Create; function CreateEntity(const data: DOMString): TDOMEntity; end; -- snip -- it's been a bit since i played with the FPC implementation of the XML stuff, but i've done quite a bit of work with DOM in Java. i've included the interface from dom.pp in the 2.0.2 source above for reference. first thing, you need to understand is that TDOMDocument is the "handle" to the DOM. so you need to start with an instance of one of these, either by creating one, or by "loading" an XML document. from there, you ... a) create "nodes" by calling methods on the TDOMDocument (the parent of all nodes). i included some of the specific and more common methods from TDOMDocument below, such as the function, and the function for instance. -- snip -- function CreateElement(const tagName: DOMString): TDOMElement; virtual; function CreateTextNode(const data: DOMString): TDOMText; function CreateCDATASection(const data: DOMString): TDOMCDATASection; virtual; function CreateAttribute(const name: DOMString): TDOMAttr; virtual; -- snip -- again, you call these on a properly created instance of the TDOMDocument ... because nodes must be "owned" by a document. b) once you have a node, and you've mutated it (set its value etc ...) to your liking, you can then parent it into the XMLDocument by walking the DOM ( getChildren() etc ...) until you get to a node that you want to attach your newly created node to, as a child or sibling or what have you. you create attributes in the same way, by calling methods on the TDOMDocument, which return instances of the attribute class, and then they can be attached to a node in the tree as required, becoming an attribute of that node. you never instantiate nodes and attributes directly, at least not ime. Felipe Monteiro de Carvalho Tony -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] real to integer
On 5/29/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: Use a IDE with code tools that support find declaration. that is a terrible answer. this isn't the "IDE" list, it is the Free Pascal "compiler" list. i would have beat my head against a wall for days on a problem like that. i would suggest that this is an opportunity to think about error reporting in the compiler. i would suggest, as a compiler enhancement, maybe ... a) the compiler could report ambigous symbols as a warning b) the error could report fully qualifed symbols on errors i don't know how simple that is for the compiler, but it is simple to understand for the programmer. Vincent. Tony -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com http://games.groups.yahoo.com/group/x-plane-foo/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiling a unit loops infinitely
On 3/22/06, Michael Preslar <[EMAIL PROTECTED]> wrote: > > Any help would be appreciated.. http://www.freepascal.org/bugs/showrec.php3?ID=4694 > -- > Michael Tony -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com http://games.groups.yahoo.com/group/x-plane-foo/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] OT : testing spam filtering to list ?
sorry for doing this, but i got a bounce on a list reply. will this message go through ? -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com http://games.groups.yahoo.com/group/x-plane-foo/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] WinSock
On 3/15/06, Bob Richards <[EMAIL PROTECTED]> wrote: > I have fpc-2.0.2 running on Linux WinSock = "Windows Sockets" <> Linux Sockets ? You might want to look at some of the abstraction libs available, such as Synapse. also, and i'm not sure about this, as i've been meaning to ask, but i think the stuff in the "Sockets" unit is meant to be a cross platform sockets API ? anyone know about this ? i'm going to be doing some (hopefully) cross platform socket stuff soon. > > Bob Tony -- X-SA user ? 0.5.1 is out ! XData 0.1 for X-SA is out ! http://x-plane.dsrts.com http://games.groups.yahoo.com/group/x-plane-foo/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Polymorphism question
i'm new so grain of salt ... On 3/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > function GetMyProperty: string; overload; > procedure SetMyProperty(Value: string); overload; should these be 'override' rather than 'overload' ? -- X-SA user ? 0.4 is out ! http://x-plane.dsrts.com http://games.groups.yahoo.com/group/x-plane-foo/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] static binding to C shared library (linux)
On 1/17/06, Alain Michaud <[EMAIL PROTECTED]> wrote: > Hi, > > thank-you for the reply. > > 1 - I compile the C library myself. I even use it from a C program > compiled by me. Therefore for the C part, I am sure that everything is > OK. I also know that the path, and all that works. ok. > > I can also access a string constant (the version number) from the > library using my pascal program. ok. > > This makes me think that it has to do with the parameters. This one has > three. Unfortunately there is no other 'simple' function in the > library: > > int pl_setplparam (plPlotterParams * plotter_params, const char > *parameter, void *value) > > which I translate into: > > function pl_setplparam (plotter_params:plplotterparams; const > parameter:PCHAR; value:PCHAR):cint; cdecl; external 'plot'; i hope someone else on the list will jump in here ... but i'll stick my neck out ... i'm doing this off the top of my head ... you should really read the doc for the compiler. i think your first parameter should be declared as a _pointer_ to the type : plotter_params : plplotterparams^; and i think _technically_ that third param should be : value : Pointer; > > Is the "cint" type equivalent to C: "int" ? should I use "smallint" > instead. i'm not sure. a smallint is a short in 'C' i think. you really have to find out where cint is declared in your 'C' environment and then look that up in the pascal doc. you could try guessing ... and maybe it won't segfault. > > 2 - Someone tells me that old compilers would accept " * int" while the > new compilers would prefer a variable name: "variable * int" or "void * > int". Unless this the other way around then I should not use the > NO_VOID_SUPORT. So I guess I do not worry about that one any more. that sounds like it is a define to deal with old/new style function prototype stuff in 'C'. i don't think this bit matters to Pascal. > > 3 - The file I have is "libplot.so" I think that this is a shared > library. Does that coresponds to "cdecl; external 'plot';"? If not, then > this is where my mistake was!!! cdecl is a directive that declares the "calling convention" for the function i think. this makes it so that the pascal compiler knows how to generate code to invoke the 'C' function and/or pass variables to the 'C' function. the external is telling the pascal compiler that the function implementation is "external" ... somewhere ... later. i'm honestly not sure how the "name" thing works. i'd need to look that up. i think the name ties to the "linker directive" in some way. > > Is: external 'plot'; equivalent to: {$L liplot.so} or: {$Linklib > liplot.so} ? well ... i think "external 'plot'" says "find this function in the 'plot' library". i think the {$L libplot.so} says, link the libplot.so library. i think there is some magic here ... in that the linker does some things with these names. so ... i think "plot" for your external declaration works, because the linker, when it processes your {$L} directive, matches the "plot" with "libplot.so" by stripping the "lib" and the ".so" portions to match the names. or something like that ... its those two pieces though that tie everything together for the linker, so that the linker knows that there is going to be a function in an external library first, and then later, it tells the linker to actually link the library, and during the link phase, the linker is going to make sure it can "resolve externals" ... which is to say that it makes sure that it can find all of the functions you declared "extern" in the libraries you've told it to link. > > 4 - The structure "plPlotterParams" is not defined in the .h file. > Belive it or not, there is only one line: > > struct plPlotterParamsStruct plPlotterParams there has to be more to this somewhere. keep poking around in your header files. > > I understand that this is just a name change and plPlotterParamsStruct > was the name used inside the library. Why is this not defined remains a > mistery for me! Apparently the linker just assumes that it is a pointer! i don't think this is right. in order for you to use the 'struct' ... you have to know how it is composed. > > You are right. The "user" is not supposed to access the "struct" > directly. This is only a handle for the second function, therefore there > was no need to define it in the .h file. I guess I can find the > definition in the source code! However It seems to me that a "generic" > pointer should do. (What if did not have the source code) > > Is the pascal type "pointer" EQUIVALENT to the C operator: '*' to a > struct? well ... i _think_ in Pascal : "Pointer" in pascal is equivalent to "void*" in 'C'. this is reffered to as a a "void pointer" or an "untyped pointer". "typed" pointers are pointers that point at a known type of thing, rather than just being known to point to an address : Pascal : Var foo : Integer^; 'C' : int* foo; i think that is how that works. > > Thank you so muc
Re: [fpc-pascal] static binding to C shared library (linux)
take what i have to say with a HUGE grain of salt because i have no idea what i'm talking about. On 1/16/06, Alain Michaud <[EMAIL PROTECTED]> wrote: > Hi, > > I would apreciate if someone could give me some advice please. In this > example: > > cfunction = function(theparameter:cint):cint;cdecl;external'theclib'; > > It seems that this will not build unless I have the > file: /usr/local/include/theclib.h > > 1-Is this true? > 2-Does the FPC compiler read this .h file? > 3-Does the linker read this file? not sure about that, i haven't done alot of work with external 'C' libs. i have called DLL's written in 'C' before though ... and haven't had to worry about having the headers for them, as i've had Pascal files with the right stuff in them. > > > The C prototypes for the two functions that I want to use look like > this: > > plPlotterParams * pl_newplparams(void) > > or: > > plPlotterParams * pl_newplparams > > and: > > int pl_setplparam (plPlotterParams * plotter_params, const char > *parameter, void *value) > > or: > > int pl_setplparam (plPlotterParams * plotter_params, const char > *parameter, char *value) > > The two set of prototypes exists because of a switch: "NO_VOID_SUPPORT" > to accept different compilers. > > 1 - Does anyone knows which case my compiler uses? "void" or "no_void"? well ... i think that is some sort of 'C' pedantry having to do with whether you have to declare that your no-arg 'C' function takes 'void. are you compiling this lib ? or is it already compiled for you ? or ? i guess i should back up and ask the big question ... how are you trying to use this 'C' lib ? as a shared library ? i don't think Pascal should care about the void/no_void thingy. > > > The first function "pl_newplparams" is suposed to allocate a structure > then return a handle. It seems that it returns something different than > "nil" but I am not sure if it is valid however. your function, as you've written it here, appears to be returning a pointer to something of type 'plPlotterParams' ... presumably a struct. > > This pointer is used as a parameter for the second function > "pl_setplparam". > > ERR := pl_setplparam(plotter_param,'PAGESIZE','letter'); > > As soon as I call the function I get an "access" exception at the offset > 0. Although the function has 3 parameters, it could be the first > one (the pointer) that has the wrong type! > > I have tried many things like this: > > type > plplotterparams = record end; i think you have a few issues : a) you can't just make up your own record for the parameter type. you've got to find the definition of plPlotterParams 'type' in the 'C' source, and then define a type in Pascal that matches it. presumably, it is a 'C' struct, so you care going to define a Pascal "record" ... but you have to define the members of it properly. once you've defined the "record" in Pascal to match the 'C' struct (assuming that is what it is) ... i think your Pascal code will go something like as follows : Var my_params^ : pascal_plPlotterParams; // pointer to your pascal type my_params := pl_newplparams(); pl_setplparams(my_params,); > > function pl_newplparams:plplotterparams; cdecl; external 'plot'; > > function pl_setplparam (plotter_params:plplotterparams; const > parameter:PCHAR; value:PCHAR):cint; cdecl; external 'plot'; > > Can someone give me some hints on how to solve that problem. I have > spent the whole week-end on these three lines and I am quite frustrated > right now! The package is called "libplot" ("plotutils") and I was > planning to put it on the web if I can get it to work. :( so yeah ... as i've said ... i _think_ you have 2 primary problems : a) you've got to define a type in Pascal that matches the "type" that your first function returns. b) you've got to use Pascal "pointer" syntax when defining your "handle" in Pascal for the variable you are going to use to capture the pointer being return from your func. btw ... i _suspect_ that, if you aren't going to _use_ the value being return from the first function, you could just use a "void" pointer type in pascal to retrieve the address of the thing being emitted from the first function ... and just pass it to the second. Var my_point : Pointer; my_point := firstfunction(); secondfunction(my_point); ... or something like that. of course, if you actually want to manipulate the thing being returned, to modify it's members or something ... you will have to define stuff in Pascal so the compiler can generate the code needed to get at the members within. > > Thank you for reading all guesses ... but sure ... > > Alain Michaud Tony -- X-SA user ? 0.4 is out ! http://x-plane.dsrts.com http://games.groups.yahoo.com/group/x-plane-foo/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] source file size ?
On 1/5/06, Florian Klaempfl <[EMAIL PROTECTED]> wrote: > Tony Pelton wrote: > > hi all, > > > > i wanted to ask a question, before i spend time going down a road to > > implement it. > > > > are there any thoughts on having a source file that might be megabytes > > in size that is basically just structured data implemented as source ? > > up to 2 GB, the important thing is the size of the resulting parsing > pieces. I.e. very long procedures (>10k lines), statements, expressions > call for trouble. this is the answer that answers my question i think. while i hadn't thought it all the way through, in fact, the picture i had in my head was one where there would be one massive function, that i would call when my DLL was initialized, that would create all of the "records" of data and add them to an array or collection for use by the application at runtime. i might be able to break that function into several somewhat smaller functions, and aggregate the calls to each on via one. procedure init(); begin do100(); do200(); do300(); . . . end; procedure do100(); begin { add 1-100 of the N elements here } . . . end; procedure do200(); begin { add 101-200 of the N elements here } . . . end; thanks for the thoughts ... Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] source file size ?
On 1/5/06, L505 <[EMAIL PROTECTED]> wrote: > > > are there any know limits on how big a source file can be for the FPC > > compiler ? > > interesting question... hmm did you try a 3GB file which calls > writeln('test') over > and over and over again? > That's the stupid way of doing tests - the smart way would > be waiting for an answer from the FPC team. hmmm ... i'm sensing some sarcasm. i'm not usually one to post dumb questions to a list because i'm lazy or have nothing better to do. also, i thought this was the "users" list ... not the compiler developers list. in any event ... i have no idea if putting 3GB's of "writeln" statements in a file is a good test. in my case, the data would have to have structure. it isn't just the size of the source file, but the size of the code as generated by the compiler into the DLL. are there limits to the "code segment" or other such internals of the compiler and runtime file ? i think the way i would have to lay it out would be to have 1000's of Pascal "record" types, with members that are a mixture of "constant" String and Double values. i guess i would have to put all of these "record"s inside of a procedure that alloced and assigned them all as members of an array, upon invocation of the function at runtime ? maybe i could put them in the initializer ? it would actually take me some time to even lay the thing out to begin with ... only to find that it doesn't work ... or that I _assume_ it won't work ... because i took one path that didn't work, where there might have been another that would have ... had i known. so you see ... i feel like it is maybe more complicated that just testing by echoing 3GB's of "writeln" statements into a source file and compiling it. if no one has any thoughts on it ... i'll go to the next step ... but i didn't think it would hurt to ask the question. but thanks for the help. > > Here are my prefered colors for your website (take it or leave it): > > body bgcolor="#1E1E1E" text="#D7D7D7" link="#006699" alink="#006699" > vlink="#006699" > > Gotta love dark backgrounds. > > hmmm website Sigs really do work because I went ahead and clicked on your > site. hmmm ... i just don't know if i'm reading into the intent of your comments very well. btw ... the screenshots you see there are screenshots of a plugin i've written for a simulator i use from http://www.x-plane.com ... using Free Pascal. > > -- > L505 Tony -- X-SA user ? 0.4 is out ! http://x-plane.dsrts.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] source file size ?
hi all, i wanted to ask a question, before i spend time going down a road to implement it. are there any know limits on how big a source file can be for the FPC compiler ? i was thinking about experimenting with "code generating" a source file that would become a memory resident database of sorts. this would make my application, implemented as a shared library "plugin" quite fast, and would potentially simplify the distribution of my shared library to my user base. are there any thoughts on having a source file that might be megabytes in size that is basically just structured data implemented as source ? tia, Tony -- X-SA user ? 0.4 is out ! http://x-plane.dsrts.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] XML DOM stuff
hi all, i've been toiling over the DOM implementation with the FCL for a few hours now. i had successfully used the XMLRead code to load a DOM from an XML file. i had successfully mutated said document and used XMLWrite to persist those changes to the DOM. i've now been beating my head against the wall trying to figure out how to build a DOM "from scratch" in code. My trouble begins because it would seem that i don't get a "well formed" document by doing a straight "Create()" of an TXMLDocument. i've been digging around inside of the XMLRead code for a bit, trying to understand what _it_ does to get a document going from an XML source file. it's confusing to me. i see some casting and subclassing inside of the XMLRead code that seems to allow for the creation of a well formed TXMLDocument, but i don't see anything that leads me to a well formed API or "factory" for being able to instantiate an "empty" but well formed XML document myself. minimally, i'm having problems because i can't see how to get a DocumentElement attached to the DOM instance via a user serviceable API call. so i can't attach any new elements to the document after a Create(). what am i missing ? tia, Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Quake 2 for Freepascal
On 12/29/05, L505 <[EMAIL PROTECTED]> wrote: > If anyone is interested I can post the Quake 2 freepascal port up online. i'm interested in looking at the code from an academic perspective. please do post. i could even help mirror it if need be. Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiling library / Win32 DLL
On 12/29/05, chromdildo <[EMAIL PROTECTED]> wrote: > Thanks for your reply. > > Whats the difference, when compiling without Lazarus? i don't know. i just wanted to mention it, in case it was relevant. i had started doing development using the FP console IDE. i then "discovered" Lazarus, and wanting to be able to use a GUI IDE, i downloaded and installed it. i then took the exact same code, compiled it, which produced a DLL for me, and when i tried to get my hosting application to load it, it complained, saying it wasn't a DLL. i then loaded the FP IDE, recompiled the same code, and it went back to working. i posted to the list, asking questions about my problem, but no one seemed to know why i might be having the problem. someone even sent me a "dll loader" tool to test whether my DLL would load with their testing tool. the DLL _did_ load with the tool, but the application i was using still wouldn't deal with it, until i recompiled it with the FP console IDE. since then, i've just stayed with the console IDE/compiler and i haven't had any issues. just as another thought ... because i recently had a problem that really messed me up for a couple of hours. i had installed the newer 2.0.2 compiler, after having used the 2.0.1 compiler on my windows machine for a while. i then loaded up some of my source, and went about doing more development on 2.0.2. when i started testing some of my latest code changes, as a DLL within another application, i was getting ALL KINDS of crazy behavior. no crashes, just really bizzare behavior from some of the API calls i was using for my third party application. stuff that is really hard to explain in any detail in an e-mail ... but things like "enumerators" within the API suddenly stopped enumerating ... without error ... function calls that returned enums were returning the wrong enum value ... stuff like that. after alot of head scratching and poking and prodding ... i ended up cleaning up a bunch of "dot o" files from some of the units for the third party API wrappers that are implemented in pascal, and which were being compiled by FP. my problems went away. some kind of weird issue between 2.0.1 and 2.0.2 in the object files. i'm not sure if this would be considred "unexpected" ... but at the time it just didn't occur to me. so ... make sure you are building all your code, and dependent source code "clean". $0.02 Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiling library / Win32 DLL
you are using FP or its IDE and _not_ lazarus ... right ? i had some troubles with building a DLL with lazarus, where identical code would build link under lazarus, and my windows application wouldn't load it, and everything would work fine when i built it using the FP compiler standalone. likely a user error, but i was never able to figure it out. my $0.02 Tony On 12/29/05, chromdildo <[EMAIL PROTECTED]> wrote: > Hallo list. > > I'm having trouble with library/DLL under Win32 (exporting one function > and having a little GUI). > Compiles fine, but the host application can't load them. The Host is > closed source (think MSVC). > > Same code compiles and runs fine with Delphi. > > Can someone describe the main differences with building/linking > libraries under Delphi/freepascal. > I'm sure I'm missing some compiler/linker - switch. > > Thank you very much > chrom > > P.S. Merry Xmas and happy new year to all. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] sax.pp
On 12/27/05, Sebastian Günther <[EMAIL PROTECTED]> wrote: > Tony Pelton schrieb: > > hi all, > > > > i'm a pascal noob, but not a new programmer. > > > > i've done a fair bit of XML parser work in Java. > > > > i was trying to figure out how to do parsing with SAX in pascal last night. > > > > i'm very confused. > > Okay I can imagine this... ;) > > the actual SAX support is for HTML parsing only. The XML parser can only > create DOM documents, without using the SAX layer. hmmm ... ok, let me make sure i understand. the code in "sax.pp" is not for general use as a sax parser but is in support of some other code, somewhere else, for doing html parsing ? ok. that's kind of a bummer. i guess i'll have to go back to the drawing board for what i'm trying to do. marshalling the entire XML document into memory is potentially problematic for my application. > Regards, > Sebastian thanks, Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] sax.pp
On 12/27/05, L505 <[EMAIL PROTECTED]> wrote: > > Would need to see some sample code that is giving you the abstract error, > though. I > just finished dealing with an "abstract error" and all I did was forget to > place the > override keyword after the function declaration in the *derivative* class. thanks for the response. i'm including some code. it compiles, but generates a runtime error : An unhandled exception occurred at $0040691E : EAbstractError : Abstract method called with java, unless you are hiding the implementation from the compiler, by using runtime classloading for instance, the compiler will tell you that you are trying to use an abstract class and what abstract thing you are trying to use and that it is bad and wrong. so this pascal code wouldn't get past the compiler were it java. note that i was just trying to get to a starting point of being able to capture "character" events from the parser and write them to stdout, nothing more. also note that i've got all of the other events commented out for starters. i must be missing something blatant, likely due to my inexperience with pascal. thanks for any help. Tony PS. btw, a url (http://x-plane.dsrts.com/screenshot_0.bmp) with a screenshot of a "plugin" i've written for a flight simulator using FPC, and to which this issue is related. all of the "brightly colored" bits that you see in the screenshot are the work of my plugin within the simulator and is all written in pascal as a windows DLL using OpenGL calls. The simulator API also supports 'C', but I had come close to suicide on more than one occassion trying to write 'C' and had almost given up, when i thought to try FreePascal. i've never looked back. 'C' sucks, FreePascal ROCKS ! -- SNIP -- program Main; Uses // heaptrc, SAX, Classes, Objects, Math, StrUtils, SysUtils; Type Tmyfilter = class(TSAXFilter) procedure DoCharacters(const ch: PSAXChar; AStart, ALength: Integer); override; end; procedure Tmyfilter.DoCharacters(const ch: PSAXChar; AStart, ALength: Integer); begin WriteLn(StrPas(PChar(ch))); end; { procedure DoCharacters(const ch: PSAXChar; AStart, ALength: Integer); dynamic; procedure DoComment(const ch: PSAXChar; AStart, ALength: Integer); dynamic; procedure DoEndDocument; dynamic; procedure DoEndElement(const NamespaceURI, LocalName, QName: SAXString); dynamic; procedure DoEndPrefixMapping(const Prefix: SAXString); dynamic; procedure DoIgnorableWhitespace(const ch: PSAXChar; AStart, ALength: Integer); dynamic; procedure DoProcessingInstruction(const Target, Data: SAXString); dynamic; procedure DoSkippedEntity(const Name: SAXString); dynamic; procedure DoStartDocument; dynamic; procedure DoStartElement(const NamespaceURI, LocalName, QName: SAXString; Atts: TSAXAttributes); dynamic; procedure DoStartPrefixMapping(const Prefix, URI: SAXString); dynamic; } Type TDosStreamPtr = ^TDosStream; Var a_name : FNameStr; Var a_stream : TDosStreamPtr; Var a_filter : Tmyfilter; begin a_name := 'google_earth_tutorial_files.kml'; a_stream := new(TDosStreamPtr,Init(a_name,stOpenRead)); a_filter := TmyFilter.Create; a_filter.ParseStream(@a_stream); end. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] sax.pp
hi all, i'm a pascal noob, but not a new programmer. i've done a fair bit of XML parser work in Java. i was trying to figure out how to do parsing with SAX in pascal last night. i'm very confused. in java there are basically three steps to doing SAX parsing : 1) subclass a "handler" and override the methods for the parsing events you want to trap, such as "begin element". 2) create an instance of the XML parser, and pass an instance of your "handler" to it. 3) pass in an XML document to the parser and tell it to parse. your handler then gets callbacks from the parser with data from the xml document. in looking at sax.pp in the 'fcl' for free pascal ... i got confused. for one thing, i don't see any code in the source file that looks like it is actually doing any parsing ? i expected to see a bunch of code in there somewhere that was doing a bunch of string comparison and manipulations at the character level, like and parser would have to. maybe there is other code that i haven't looked at that fills in some of the gaps ? second, for hoots and hollers, i subclassed/extended the SAXFilter class ... thinking that it looked like the descendent of everything else, thinking that it was itself the parser and handler, and tried to override some of the callback functions ... but when i call parse on it, i get an error about abstract methods. i'm lost. help ? documentation ? sample code ? Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] LINKLIB on Cygwin
do you have the DLL's somewhere in your PATH so that the windows lib loader can find them at runtime ? e.g. PATH=c:\cygwin\lib ? Tony On 12/19/05, Alan Mead <[EMAIL PROTECTED]> wrote: > Jeff Pohlmeyer gave me a short program demonstrating the use of the readline > and history libraries, the program begins: > > program histdemo; > {$LINKLIB ncurses} > {$LINKLIB readline} > {$LINKLIB history} > {$LINKLIB c} > It works great on Linux but I haven't been able to figure out how to get it > to work under Cygwin. I have the libraries in c:\cygwin\lib (e.g., > libncurses.dll.a) and I have found different forms that allow the program to > link (e.g., "{$LINKLIB ncurses.dll.a}" or "{$LINKLIB libncurses.dll.a}") but > when I run the program I get a Windows dialog titled "Unable To Locate > Component" and displaying "This application has failed to start because > readline.dll was not found..." > > I know very little about Windows programming or linking external libraries... > any thoughts would be appreciated! > > -Alan > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] getting XML element's value using dom.pp unit
On 12/8/05, Bisma Jayadi <[EMAIL PROTECTED]> wrote: > > i think you are going to find that "my node value" is not the > > NodeValue() of , but is the NodeValue() of a _child_ of > > . > > Thanks Tony... using your information, I've found what the problem is. It's a > different way of understanding XML node, between a Delphi XML (DOM) component > and a FPC DOM unit. I used to be a Delphi programmer, trying to migrate to be > a > Lazarus/FPC programmer. :) . > I got '#text' string on "n" variable. This confirms Tony's information that > node value that I'm looking for is actually a child node (with "#text" as the > node's name). :) i'm not sure ... but i think that having the "#text" child node is per the spec : http://www.w3.org/XML/ in any event, as i said, every Java DOM parser i've worked with does it that way. glad to have helped. > -Bee- Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] getting XML element's value using dom.pp unit
i'm going to speak out of turn here ... i've got a ton of XML experience ... on Java. I haven't used the Pascal DOM, but i'm guessing i know what the issue is, because it is a common point of confusion for people who don't know XML DOM frameworks well. i of course may end up being completely off base. assuming you had a node in the document like : ... my node value ... i think you are going to find that "my node value" is not the NodeValue() of , but is the NodeValue() of a _child_ of . so you have to step one deeper into the DOM. i think ... Tony PS. also, including a sample of the XML document, along with the code is usually helpful. On 12/7/05, Bisma Jayadi <[EMAIL PROTECTED]> wrote: > Hi all... > > > What did I do wrong? Or am I missing something about the dom.pp usage? Here > are > the codes I used... > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Remote FreePascal compile service, feedback requested
On 12/5/05, Tom Verhoeff <[EMAIL PROTECTED]> wrote: > Why do this? Because that way people can use/try FreePascal without > installing anything. ah ... installing really isn't too complicated currently. download a tarball, expand it, and run the compiler ? i can't imagine having to fiddle around with some webapp is going to be any simpler than that. > Mabye we can support cross compiles as well. _this_ might actually be compelling. i use FreePascal for developing plugins for a flight simulator for instance. the flight simulator runs on windows, OSX and Linux, but i only have access to windows and linux for compiling. being able to cross compile to OSX would be cool. there are others in the same community of people who use Delphi, that i have been trying to hook into FreePascal who have the same problem. being able to point them at a place to cross compile their Delphi projects to non-windows platforms would be cool. > > Furthermore, we plan to support several versions of FreePascal in > parallel. That way, it may also be useful to the FreePascal community. > E.g. when diagnosing a problem. i suspect anyone who is "diagnosing" anything to this detail is going to want to have their versions/tools locally so that can see what is going on. > > Tom Verhoeff Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] free vision questions
hi all, having a great time playing with free vision right now. a quick question ... can i get a hooked into the event loop thread for doing work ? said a different way ... based on my experience with other event driven GUI paradigms ... i'm assuming ... in the background, there is a thread of execution that is polling for events in the ui, keyboard and mouse and dispatching those events into the event loop ? i then trap those events in my code and "do stuff". standard event driven gui stuff. i would love to be able to "poll" some of my own code from the existing event thread, checking for network data, and then dispatch events into event queue that i can then handle inside the event loop, to update widgets with the data. is this a reasonable line of thinking for FV ? am i overthinking this ? in other ui subsystems i've worked with (GUI rather than console) it has always been imperative to be careful how you deal with widgets when you aren't the event/refresh thread. bottom line, if possible, i would like to avoid spinning my own thread to do network polling, and once i see some data on the wire, i want to be able to *safely* process that data and dispatch it into widgets in realtime. i'm still trying to understand widgets and their relationship to "backing" record types and pointers to data as well. not sure if i'm suppossed to initialize widgets with their backing data structures once, and then use handles to those structures to just change the data and the widget will refresh and show the data. anyway ... i might be digressing. mostly, i'm just trying to understand if i can hook my own code into the event loop thread and take advantage of the thread to do polling of my own. tia, Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] cgi-bin/PSP
i don't know if i will get beat down for asking this question here ... but i'll try. i found a pascal web server : http://www.ritlabs.com/en/products/tinyweb/ it supports CGI suppossedly. if i try to get it to use a PSP CGI, the web server renders a response that says the CGI didn't return anything. in looking at the source, and the CGI examples that come with the tinyweb server, their example just does "WriteLn" stuff, writing to standard out. does anyone know, quick and dirty, if the PSP framework is writing to 'stdout' ultimately ? sorry for asking here, i just didn't want to have to join another handful of lists to get information, if i didn't have to, and i was pretty sure there might be some PSP lurkers on this list. tia, Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] console ui ?
hi all, i'm trying to hone in on a toolkit to use to do some "console gui" development. something along the lines of the FP IDE, but not as complicated. cross platform as well hopefully ? i'm having trouble understanding what the deal-ey-o is with the "FV" libs ? is there a licensing issue here ? where is the doc and source for the "FV" libs ? would the "nCRT" libs be a better choice ? other thoughts ? i'd hopefully like to find something that should be cross platform (windows, mac OSX, linux) console gui toolkit, that has basic features. menus standard dialog boxes windows and hopefully something that has source and/or doc for it. but most importantly, i'd like to find something that has a future in terms of licensing and some support/development in the community. thanks for any tips, Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] RE: Download file
On 11/18/05, Jeff Pohlmeyer <[EMAIL PROTECTED]> wrote: > > If you don't mind using an external DLL, CurlPas is quite simple, and presumably, if you are crafty, and licensing supports it, you could link the curlpas runtime statically such that you don't need the lib. Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] File locking/protection in Linux
On 11/2/05, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > On Wed, 2 Nov 2005, Antal wrote: > > > How can be avoided in Linux the file corruption due to simultaneous write > > access from two different process? > > Nothing prevents a third process from using the file without locks. that was what i thought too. but that link i posted seemed to imply that, if you mounted the filesystem with an extra flag, that the kernel would cause any regular process to wait for access to files, if those files had been "flocked" by any one process, so it then only takes 1 process using the "flock" calls to get exclusive access. from the link : "In these cases, you can enforce locking at the kernel level with mandatory locks. Mandatory locking is implemented on a file-by-file basis. When a program attempts to lock a file with lockf or fcntl that has mandatory locking set, the kernel will prevent all other programs from accessing the file.[1] Processes which use flock will not trigger a mandatory lock." > > Michael. Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] File locking/protection in Linux
without looking at what the PSP code is doing ... an article on this subject, specific to file locking on linux ... http://lists.jammed.com/ISN/2003/06/0104.html Tony On 11/1/05, L505 <[EMAIL PROTECTED]> wrote: > > How can be avoided in Linux the file corruption due to simultaneous write > > access from two different process? > > Or how can it be avoided to access the same file by two different process? > > I experienced a few (but painful) data loss due to this problem, and I'm > > unable to solve the problem. > > > The Pascal Server Pages project has a unit in it that allows this if you are > interested. It > is not specific to Pascal Server Pages as far as I know. > > Basically how it works is a simple time delay is put on the file until it is > free again. > You can check FileShare.pp if you are intersted in a file locking read/write > method. > > SVN: > https://opensvn.csie.org/pspcgi/psp-1.5.x-devel/src/fileshare.pp > > For documentation on how those units would be used, check: > http://z505.com/cgi-bin/psp/docs/1.4.1/psp_doc_i.cgi?p=mod.fileshare.html > > Again, these units and documentation were written with regards to CGI > programming. However, > file sharing is not specific to cgi programming of course! > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Systems 2005: A first summary
On 10/29/05, Sebastian Günther <[EMAIL PROTECTED]> wrote: > Tony Pelton schrieb: > > > another thing that most java ide's do, which may or may not apply to > > lazarus, is that most IDE's have the ability to support more than one > > compiler suite at a time. > > Yes but that is quite meaningless for the case of Free Pascal. I don't > think that Lazarus ever will support the compilers of Delphi or Kylix. > Those both projects are more or less dead already (Delphi will be dead, > if Borland will continue their chosen path). just to clarify what i was trying to say : i wasn't neccessarily suggesting that Lazarus should support different Pascal compilers, though that might be a good thing. i was more suggesting that Lazarus might do well to be able to easily switch between different installations of the Free Pascal compiler. for instance, i run Gentoo (which has a rather messy bunch of freepascal e-builds on it, which at some point i intend to rectify) but where it has 1.9.4 and 2.0.0-r1 compilers available minimally. in addition, i have an SVN checkout sitting on my hard drive locally. being able to switch between the different compiler version easily might be of interest to some users potentially. in any event ... I Love Free Pascal !! Long Live FPC ! ;) > > - Sebastian Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Systems 2005: A first summary
On 10/29/05, Sebastian Günther <[EMAIL PROTECTED]> wrote: > Tony Pelton schrieb: > > > > their (sun's) model is one where they offer the bundle that you need, > > where you may want a big thick bundle with the Java compiler and > > runtime and IDE, or you may already have the Java runtime and > > compiler, and just need the IDE. > > For Java the situation is different. There are lots of IDEs, but Free > Pascal has only one major IDE. well, firstly, there appears to be at least one other decent IDE that i know of : http://www.bloodshed.net/devpascal.html but in any event, i'm not sure why that distinction is important. i think the point of the bundling strategy is not in the number of IDE's. i think there are a few more relevant points : *) the IDE is kind of pointless without the compiler *) the compiler doesn't *require* the IDE. *) giving people a complete, one stop development solution is a good thing. but like Java, i think it would be of paramount importance to make sure that the compiler can also standalone, without the IDE and it's runtime, for those that want to use alternative IDE's, or where you want to be able to integrate the compiler in with an OS distro or what have you ... > Of course the talk is _not_ about a complete fusion of FPC and Lazarus. > 'Only' the following parts should be merged: > - Website > - Download directories on the website. Especially we need a clear and > short explanation of the different packages. > - The Wikis > - Documenation? But this is a major topic, which we should discuss > separatedly > - Perhaps the bug system and if this were my project(s), i personally _wouldn't_ advocate for merging all of that stuff together. i would keep the projects mostly seperate *except* for the front pages of either site, where i do my marketing spiel about how the projects are complimentary AND i would make sure the projects cooperate enough so that they can always be bundled seamlessly with each other, and each projects download page should offer their own product AND the bundled product. so the users get nice, easy to understand, packaging options both for just the compiler tools and/or the IDE, but the projects still get to run themselves how they want, and manage their own release cycles etc. another thing that most java ide's do, which may or may not apply to lazarus, is that most IDE's have the ability to support more than one compiler suite at a time. so for instance, the IDE might require java 1.4 for its own execution environment, but might support being able to use more than one java version for supporting the developer project, such as java 1.5 for instance. having that type of decoupling and runtime compiler switching with Lazarus might be very handy in the future AND it would make it much easier for Lazarus and FPC to iterate versions on their own schedules, and allow users to upgrade just the parts that they need to, when they need to. > > There is no clear separation between FPC and Lazarus for the end-user. for a Lazarus end user I assume you mean ? > For example, an average user cannot tell easily if he has a problem with > a component or function belonging to Lazarus or belonging to FPC. and again, if they were bundled together, but also properly modularized, if the FPC or it's runtime was to blame for a bug, or Lazarus was, the source of the problem could be better identified because of the modularization, and then just the suspect part could be upgraded to solve the problem, rather than having to download the whole big bundle, after the bundle has been updated by the responsible project. > > - Sebastian Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Systems 2005: A first summary
On 10/29/05, Florian Klaempfl <[EMAIL PROTECTED]> wrote: > L505 wrote: > > >> > >>I think that FPC has to remain FPC, a language + compiler just like GCC. > >>IDE and Lazarus could be run on top of FPC, like many IDE run on top of > >>GCC. that would be my preference, not that my preferences matter in the slightest. i think the GCC analogy is right. > > No, this doesn't match with our experiences we had at the systems: a lot > of people said, yes, I tried fpc but I didn't like to work with the > command line. When we asked, did you try lazarus, the answer was, no, I > didn't know about it. FPC is a darn sweet little compiler and could/should become as common on Linux at least as bash and perl and GCC are now so that it will see more adoption as an alternative to 'C'. i know that is why i've become an FPC convert. i got tired of pulling my hair out with 'C' for some of the small toys i was playing with for my flight simulator plugin work, but my "other" language, Java, just wasn't up to the task of building lightweight and performant code. this is when i "discovered" Pascal and the FreePascal compiler tools. i will admit that it took me a while to figure out how Lazarus was related, and i found the FreePascal and Lazarus sites confusing at first. i think the one, most productive thing, both projects could do for themselves, and for the community at large, is to bring the two entities together, into a more cohesive looking and feeling website and to market them as layers of building blocks for doing plain pascal development with minimal tools or as a larger set of tools for doing GUI RAD. but again, i wouldn't change them architecturally, other than maybe making integrated, easy to use/install "bundles" out of them. FreePascal and Lazarus might want to look to how Sun and the Netbeans project have aligned the Java tools and the Netbeans IDE. http://www.netbeans.org/downloads/index.html this seems like an analagous model to that of FPC and Lazarus. their (sun's) model is one where they offer the bundle that you need, where you may want a big thick bundle with the Java compiler and runtime and IDE, or you may already have the Java runtime and compiler, and just need the IDE. imho, this would be the perfect strategy for FPC and Lazarus. Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bindings to Computational Geometry libraries
On 10/28/05, Cox, Stuart TRAN:EX <[EMAIL PROTECTED]> wrote: > There are a number of Computational Geometry libraries available from the > web. It would be nice to be able to use them in the Pascal world. Does > anyone have bindings or wrappers or translations to FP for LEDA, CGAL or say > XYZGeobench? i'm not sure if i know what "computational geometry" is ... but while i was doing some messing about with code for a flight simulator extension i was working on, i came across the following which helped me out some : http://www.partow.net/projects/fastgeo/ it is 100% Pascal code. i don't know if it would be of any interest to you. > > Stu Cox Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPCUnit article/tutorial online.
i started to write a rather lengthy reply to this note, and realized i was starting to rant. so i'm gonna shorten my reply up quite a bit. i'm a java web app programmer by trade. i use Pascal for fun stuff. up until a couple of years ago, i went through a series of companies where i couldn't escape the _nightmare_ of unit testing mantra, being forced down the development teams throat ... _usually_ with a whole helping of other ridicoulous development "paradigms" freshly read by the manager right out of "CIO" magazine. i will offer this opinion ... i think generally, and especially the way they've been implemented in the past where i've worked, they (unit tests) have been a huge waste of time and a soul sucking experience for the development team. my last 2 years, i've worked with ONE other senior developer, for a smallish company, with a web app in production, having done ~6 releases in the last 1.5 years since we went 1.0 with the product. in terms of scale, i would say it is just a smidgen smaller than the web application at my last job, where there were 12 developers, 3 managers and a "technical lead". let me express that in a formula : webapp1 + 2 developers == 12 developers, 3 managers, lead + webapp2 the current application i work on is light years ahead of the other one i worked on in terms of stability and quality what is the difference ? well, currently, me and my peer don't have several middle managers dictating our every move. we don't use RAD "tools" we use simple, best of breed open source technologies where we can we write code to solve problems when we think the investment is a better choice for us in the long run, rather than buying some "kitchen sink" solution from some vendor whose fancy sales guy took the boss out to lunch one day. we don't spend time writing unit tests. my $0.02 ... On 10/9/05, L505 <[EMAIL PROTECTED]> wrote: > Since I don't exactly know what test frameworks are, even after reading about > them for the > past few years, I'm going to ask some risky questions. This is not a flame > thrower attempt > at the test framework advocates, I'm just trying to understand what exactly > they do, from a > "newbie to test frameworks" perspective. > > Do test frameworks > -cause you to spend lots of time writing test frameworks instead of program > code? > -even apply to languages with compilers and strong typing? > -cause you to write your programs to conform to the test framework, instead > of the program > framework? > -have any actual statistics of success? > -have popularity statistics that prove they are popular (in the Delphi > community) as stated > in the article? > -have any real world examples of how they helped personX fix problemY in > significantly less > time? > > Hoping the answers are no, yes, no yes, yes, yes. > > -- > L505 > http://z505.com > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] File dates on the FPC server
hi, i'm a gentoo user. is anyone on these lists by any chance a maintainer of any of the gentoo ebuilds for fpc ? just curious. the ebuilds for gentoo seem a little behind, are masked, and they seem a little redundant/confusing. thanks for any info, Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] exit ?
hi all, new pascal guy, but not a new programmer. i'm used to being able to use the "return" reserved word in Java and 'C' to be able to short circuit the execution of a function/method. over and above any philisophical judgments on my programming technique, I see Free Pascal has a reserved word 'exit' that mimics "return" ? Is some analogy to "return" not supported in the official pascal dialect ? is 'exit' the only way to do this, and obviously, not portable to other compilers ? is there another token that i could/should use ? i do know that there is goto/label, but i would prefer not to use that, as that construct has been beat into my head over the years as being very bad. tia, Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: compiling code causes IDE to crash
On 5/23/05, Tony Pelton <[EMAIL PROTECTED]> wrote: > Var e : Double = .001; fwiw, after _alot_ of trial/error/ide segv's, i was able to isolate the problem to the above 'Var' declaration. Var e : Double = 0.001; ... works much better. *shrug* Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] compiling code causes IDE to crash
hi all, i'm new to Free Pascal. wanted to throw this out to the group, see what they thought. i was trying to port an algo written in 'C' to pascal. i had written this much of the included function, and for some reason, out of some reflex, i mistakenly tried to compile it, Alt+F9. The 'fp.exe' IDE on Windows crapped out, with the IDE "flashing" and information about how i needed to save my files as the IDE was going to shutdown. RADIUS_EARTH_KILOMETERS is a 'const : Double'. is this something i should report to someone, and if so, who/where ? -- SNIP -- { lat lon need to be in radians } function XSACalcFlatEarthCoord(lat,lon : Double) : TPoint2D; Var lat0,lon0 : Double; Var R1, R2 : Double; Var e : Double = .001; begin lat0 := 0.0; lon0 := 0.0; R1=RADIUS_EARTH_KILOMETERS(e)/(e*(sin(lat0))^2)^(3/2); end; ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] java programmer
On 5/21/05, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: > > You might want to try Decal; It's a rich set of container classes. > Although written for Delphi, it should compile for FPC without too > much hassle; if not, feel free to contact me, I'll see what I can do. this looks nice. thanks for the heads up. i was also enlightened by the other poster that pointed me at the 'Classes' unit in the RTL. somehow, i missed those. still finding my way around ... its only been a week. It looks like the Classes unit is going to put enough tools in my toolbag for the time being. again, thanks for the heads up. > > Michael. Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] java programmer
hi all, new to the list. please get out your tissues for the tear jerking story i am about to tell about how i've fallen in love with Free Pascal, then, at the end, there will be a plea for a little help. first, i want to say thanks to whomever for Free Pascal. i had never touched Pascal before about a week ago. I am a Java programmer for my day job and haev messed with 'C' a little on and off over the years to solve small problems, or to patch small bugs, but never to try and use it to do full projects of any type. For fun, on and off for probably 6-9 months, i had been trying to get competent with 'C'/'C++' to do "plugins" for an SDK that had been released for a flight simulator that consumes entirely too much of my free time. suffice it to say, using *open source* 'C'/'C++' tools to get anything done as a noob is hardcore. i was actually to the point where i had mostly given up on trying to implement plugins, because it just seemed that no matter what i tried, i would hit road blocks with compile problems, lack of being able to compile 3rd party support for some piece of middleware (XML for instance) etc, compiling to "libs" issues, export issues ... argh ... i just couldn't get anywhere. i saw a posting on slashdot a week ago for Free Pascal. i was checking out the site, and out of pure whimsy, i downloaded the Win32 package. at first, i really wasn't thinking about my 'C'/'C++' problems at all. i just decided to check out the software on a lark. as i was poking around with the newly installed software, it occurred to me, that the SDK for my flight sim had Pascal bindings. i decided to see if i could get one of the pascal examples they provide in the SDK to build/run. i actually had a couple problems with the examples because it was written for Delphi. one if fixed by poking around for a minute in the IDE and finding the "Delphi" switch. the other was to change a Use from OpenGL12 to GL. without knowing anything about Pascal, i was able to tweak a couple of minor things, and build it. I had it running in about 10 minutes. I was blown away. i've been programming and working professionally with computers for 12+ years, and within a week, i have fallen completely in love with Pascal. I found an awesome 3D "geometry" lib, that i downloaded, dropped into a directory, added a Use line for in my source and was off an running. if it had been a 'C' source project, i'd still be messing around with it. brilliant. so ... now that i've wiped the tears from my eyes. the one thing that looks like it is going to be really painful for me with Pascal is the seeming lack of out of the box data structures. in Java, there are a _very_ rich set of "collections" to use. i've done some poking around on the net, and within the "units" that come with free pascal. i'm not seeing anything right off that looks like a nice,clean,portable little unit that would emulate what i might find in java collections or C++ vector stuff. anyone know of a quality implementation of this kind of stuff ? minimally, an automatically resizing array implementation and a Hashtable ? tia, Tony ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal