Re: [fpc-pascal] Daemon doesn't work right at boottime.
Well one difference between running the init script from shell and during boot is the environment. Are you using some shell commands or something else for let say GetDirList, because during boot the path variable is not initialized as it is when you are in shell (actually I think it is empty) and if you don't specify absolute paths or manually fill it the required programs could not be located. Also look for something else from the environment that your program depends on. Try to clear the environment in the shell and try to run the init script and see what will happen.-- Geno Roupsky ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] sort procedure of T(FP)List
2006/5/6, Marc Santhoff <[EMAIL PROTECTED]>: Am Freitag, den 05.05.2006, 11:03 +0300 schrieb Geno Roupsky:> In fact you could have different function for every kind of sort and> switch them on the fly when the properties determining the kind of> sort that should be made changes. In my experience there is no much > code duplication involved in this technique and you could make for> example one compare function for every field, after that you make a> _complex_ ones calling the simple ones.The only thing I'm afraid of is stumbling into threading issues in the future (most likely when I have fogotten the details of sorting ;). It is the response of the compare function not the sorting one to synchronize whatever global(outside it's scope) variables is accesses, so no matter what approach you take you still will have issues with threads. -- Geno Roupsky ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] sort procedure of T(FP)List
2006/5/2, Marc Santhoff <[EMAIL PROTECTED]>: Hi,i wonder why the declaration of the comparing function of list objectsis the way it is:TListSortCompare = function (Item1, Item2: Pointer): Integer;Since I am writing a class that sorts a list it owns depending on another property naming the property of the list items for sorting, Iwould like to have it made a "procedure of object":TListSortCompare = function (Item1, Item2: Pointer): Integer of object; I'm dealing with lists of files and directories that should get sortedby name, date, ...If the comparing function is a plain non object function I have to makesome sort of unit global variable or the like for telling it, what property is the sort criteria. I don't like this design, although inthis case there is only one soritng process at a time.Is this a concession imposed by Delphi compatibility?It is in fact Delphi that did it that way (If you can suggest a better strategy for using this stuff, please do.) In fact you could have different function for every kind of sort and switch them on the fly when the properties determining the kind of sort that should be made changes. In my experience there is no much code duplication involved in this technique and you could make for example one compare function for every field, after that you make a _complex_ ones calling the simple ones. Either way it is not very OO based approach but of course you could make a descendand class of tfplist and add you own sorting code.-- Geno Roupsky ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] string comparison on various platforms
2006/5/3, Marc Santhoff <[EMAIL PROTECTED]>: Hi,from digging the sources I know, that on Unix-like Systems thecomparison of strings is done according to the current locale (Pascals"strcomp" is mapped to C-libs "strcoll").Can I assume that this is done similar on all other platforms, too? At least where is is possible, I mean where the OS supports locales I'm asking myself if I have to consider something special when sortingstrings or if a comparison using the RTL function will allways be"correct" (not talking of special sort orders for rarely occuring cases).Yes, if for any reason you stumble upon a bug it is most probably due to miss configuring the OS locale definitions.-- Geno Roupsky ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus.
2006/5/5, Geoff Bagley <[EMAIL PROTECTED]>: I would like to hear from anyone using Lazarus/Free-Pascal onDebian GNU/Linux.What do you want to hear?-- Geno Roupsky ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] no output window displayed
Dear Sir: I download the Free Pascal Compiler Version 2.0.2, when I run it , no output window display, could you help me to fix this problem? Thank you! Dear Linda Li,First please state your operating system so a more useful help could be provided. Secondly based on the guess that you are running fpc under Windows (I guess it is XP) I will give you some hints. First what you are probably running is fpc.exe which is in fact is a console based compiler which for a starter is not very easy to work with. I would advise you to download Lazarus http://lazarus.freepascal.org/ as it is a Delphi like GUI for developing applications with Free Pascal. Another ide is MSEgui http://mypage.bluewin.ch/msegui/Secondly try running the fpc under the console that is (under XP) run cmd and the run fpc.exe. You should see a complete list of options supported by the compiler. If for any reason the fpc could not start it will display a useful error message and you should post it in here to get more help. -- Geno Roupsky ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Constant object
I guess you're refering to the old tp days. If so you should be able to acheive constant object like that:type TCObject = object P1: Double; end;var MyCObject: TCObject;begin MyCObject.P1 := 0;end.This code should world although I haven't tested it.But there is no easy(without some nasty hacking) way to have a class instance as a constant object. 2006/5/2, Michael Müller <[EMAIL PROTECTED]>: How can I declare a constant object?var MyTest: TObject;begin MyTest := TObject.Create;end.works (for sure).How can I declare 'const'?ThanksMichael___ fpc-pascal maillist - fpc-pascal@lists.freepascal.orghttp://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Geno Roupsky ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Bit manipulation
it is as simple as this: function isset(value: dword; bit: byte): boolean; begin result := value and (1 shl pred(bit)) <> 0; end;2006/2/20, Pianoman <[EMAIL PROTECTED]>: Hi, I need to know how can I see whether a certain bit of byte/word/dword isset: or not:function like this would be appreciated:function isset(value: byte word or dword;bit:byte):boolean;for example when i pass the function parrameter a of type word and I want to see whether the bit 14 is set.RegardsPianoman- Original Message -From: <[EMAIL PROTECTED]>To: < fpc-pascal@lists.freepascal.org>Sent: Monday, February 20, 2006 12:00 PMSubject: fpc-pascal Digest, Vol 18, Issue 24> Send fpc-pascal mailing list submissions to> fpc-pascal@lists.freepascal.org>> To subscribe or unsubscribe via the World Wide Web, visit> http://lists.freepascal.org/mailman/listinfo/fpc-pascal > or, via email, send a message with subject or body 'help' to> [EMAIL PROTECTED]>> You can reach the person managing the list at > [EMAIL PROTECTED]>> When replying, please edit your Subject line so it is more specific> than "Re: Contents of fpc-pascal digest..." >>> Today's Topics:>>1. Bug in RTL for arm (Koenraad Lelong)>2. Re: Internal error 200312122 (Koenraad Lelong)>3. Re: Internal error 200312122 (Peter Vreman) >4. How to run FPC 2.x on QNX (Michael M?ller)>5. RE: tidypas (libtidy) question (Jeff Pohlmeyer)>>> --> > Message: 1> Date: Sun, 19 Feb 2006 19:04:07 +0100> From: Koenraad Lelong <[EMAIL PROTECTED]>> Subject: [fpc-pascal] Bug in RTL for arm > To: FPC-Pascal users discussions> Message-ID: <[EMAIL PROTECTED] >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed>> Hi,> Today I did an update via svn. When I compiled for arm (in the hope that> the bug I encountered a while ago would have disappeared) I found a bug > in rtl/linux/arm/sysnr.inc :> Const> syscall_nr_base = syscall_nr_base;> I modified this to :> Const> syscall_nr_base = $90;> which is similar to fpc 2.0.2. When I compiled this I got my ususal error :> /home/koenraad/fpc-devel/fpc/compiler/ppcrossarm -Ur -XParm-linux- -Xc> -Xr -Ur -Xs -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE.> -FU/home/koenraad/fpc-devel/fpc/rtl/units/arm-linux -darm -dRELEASE -Us > -Sg system.pp> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s: Assembler> messages:> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51368: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51376: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51383: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51390: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51398: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51406: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51414: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51422: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51430: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51438: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51446: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51454: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51462: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51470: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51478: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51624: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51632: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51640: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51648: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51655: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51662: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51669: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51676: Error:> unrecognized symbol type "" > /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51683: Error:> unrecognized symbol type ""> /home/koenraad/fpc-devel/fpc/rtl/units/arm-linux/system.s:51690: Error:> unrecognized symbol
Re: [fpc-pascal] Graph Unit
В пн, 2006-02-13 в 23:15 -0800, Ryo T написа: > How to use unit Graph in fpc ? > > == > 12y0 > The ~'S'~ > here is the documentation for the graph unit: http://www.freepascal.org/docs-html/rtl/graph/index.html a simple test program is attached program graphex; uses Graph; var i: LongInt; gd,gm : integer; begin gd:=detect; { highest possible resolution } gm:=0; { not needed, auto detection } InitGraph(gd,gm,''); if GraphResult<>grok then halt; { whatever you need } for i := 0 to 100 do begin SetColor(Random(GetMaxColor)); LineTo(Random(GetMaxX), Random(GetMaxY)); end; CloseGraph; { restores the old graphics mode } end.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal