[fpc-pascal] Sockets IO speed

2007-02-01 Thread Alexander Todorov
Hello, an old e-mail on the Lazarus mailing lists says: topic: [lazarus] c faster than pascal? was: Compiling GlScene ... On 6/12/06, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: [ skip ] By default FPC uses a 256 byte buffer for text IO; The C library uses a 4K buffer. Obviously, C's input/

[fpc-pascal] SIGSEGV unknown reason

2007-01-30 Thread Alexander Todorov
Hello, I have a program written in Delphi and now it is compiled with FPC 2.0.4 and running on Linux. I am having troubles to find what is causing it to break. The error I get is EAccessViolation. A short gdb backtrace is provided below. What makes me puzzle is SYSTEM_RECORDRTTI. Program receive

Re: [fpc-pascal] Inline and defines

2007-01-24 Thread Alexander Todorov
On Wed, 24 Jan 2007 10:49:07 +0100 Jonas Maebe wrote HASINLINE is simply a temporary internal compiler define which was introduced to indicate that the compiler supports the "inline" directive. It is not to be used your own code, since it will be removed from the compiler (it even has already bee

[fpc-pascal] Inline and defines

2007-01-23 Thread Alexander Todorov
Hello, What is the name of the conditional when we have inline on? I thought I can do {$IFDEF HASINLINE} but it doesn't work? Can you point me to some documentation please? At http://community.freepascal.org:1/docs-html/prog/progap7.html#x308-31G I don't see conditionals for the inline o

[fpc-pascal] PascalScript - possible bug when using with FreePascal

2007-01-18 Thread Alexander Todorov
Hello, I am using PascalScript for a very big project written on Delphi. Now it is being ported to FreePascal and I found a problem. Maybe it is a bug. The problem is: functions returning strings return empty string. In the example file the function MyFunc will always return and empty string. The

Re: [fpc-pascal] Why this code fails

2007-01-17 Thread Alexander Todorov
On 16 jan 2007, at 15:55, Matt Emson wrote: >> The reason is that it tries to convert S to a number rather than V to >> a string. The error is still in the current 2.1.1. May be the compiler should generate compile time error or a warning. I am using VarToStr anyway just tried to look more lik

[fpc-pascal] Why this code fails

2007-01-16 Thread Alexander Todorov
Hello, This code compiles with 2.0.4 but gives runtime error 231 . program project1; {$mode objfpc}{$H+} uses Variants; var V : Variant; S : String = 'test '; begin V := 42; writeln(V); S := S + V; // fails here writeln(S); end. the output is: [EMAIL PROTECTED]:~/temp/copy$ ./proj

[fpc-pascal] function Copy is inconsistent with Delphi

2007-01-16 Thread Alexander Todorov
Hello, i am converting a big Delphi project a part of uses a lexical parser. It is dependent on the Copy function which in Delphi is declared: function Copy(S; Index, Count: Integer): string; and in FPC it is: function Copy(const s: string; FromPosition, ToPosition : integer): String; Why the

[fpc-pascal] Re: Threads

2006-12-12 Thread Alexander Todorov
Date: Tue, 12 Dec 2006 10:04:48 +0100 From: "Carsten Bager" <[EMAIL PROTECTED]> On the Arm Linux platform I am using a uLibC library instead of the normal C library (I do not think that this is the problem but ??) . How do you linked your binary to uLibC instead of standard libC ? You were cr

Re: [fpc-pascal] Progress Bar in different widget sets

2006-11-03 Thread Alexander Todorov
On Fri, 3 Nov 2006 00:43:13 +0200 Graeme Geldenhuys wrote: I just implemented a basic TProgressBar widget for fpGUI and wanted to know if that Gtk progress bar feature (running left and right repeatedly) is something people actually use in applications and worth the time implementing in fpGUI.

[fpc-pascal] FPC hackers contest [was: Eye Candy Contest]

2006-11-01 Thread Alexander Todorov
On Wed, 01 Nov 2006 12:19:57 +0100 Marc PERTRON wrote: The usual answer is 'yes but you can do that with VB too'. I don't want people to compare VB and FP, but to see that FP is as good as C for heavy things ;o) And an eye-candy is one of the best examples :) -- Marc Lots of people are very fo

Re: [fpc-pascal] FPC 2.0.2 vs 2.0.4 xmlread

2006-10-24 Thread Alexander Todorov
Michael Van Canneyt wrote: XML is not in UTF-8. What do you mean by that? I don't understand. If you delete the line and save in a text file the "file" command says: UTF-8 Unicode text, if opened with web browser (e.g. Firefox) encoding is also shown as UTF-8. Opening the file with mcview in

[fpc-pascal] FPC 2.0.2 vs 2.0.4 xmlread

2006-10-24 Thread Alexander Todorov
Hello list, I had an old application that worked fine with 2.0.2 but doesn't work with 2.0.4. The problem is that it reads XML and then uses the data to do some processing. Application expects XML to be UTF-8 which is later converted to CP1251 in some cases. I an sending an example program includ

[fpc-pascal] Re: Using FPC as a scripting engine

2006-10-16 Thread Alexander Todorov
On Fri, 13 Oct 2006 12:45:55 +0200 (CEST) Michael Van Canneyt wrote: > There was no response to my first e-mail so here are some examples of > what I want to do: > > http://www.codeproject.com/csharp/runtimecompiling.asp > http://developer.apple.com/documentation/mac/IAC/IAC-334.html I find this

Re: [fpc-pascal] Using FPC as a scripting engine

2006-10-13 Thread Alexander Todorov
On 10/11/06, Alexander Todorov <[EMAIL PROTECTED]> wrote: Hello list, currently I am using RemObjects Pascal Script as a scripting language for a project of mine. All scripts are simple programs that use "API" exported from the main program. They have and some global variables

[fpc-pascal] Using FPC as a scripting engine

2006-10-11 Thread Alexander Todorov
Hello list, currently I am using RemObjects Pascal Script as a scripting language for a project of mine. All scripts are simple programs that use "API" exported from the main program. They have and some global variables defined as well. example: begin Context.ShowMessage(Params.Param('message')

[fpc-pascal] Re: fpc-pascal Digest, Vol 26, Issue 9

2006-10-04 Thread Alexander Todorov
Michael Van Canneyt wrote: > 1) If the Flag field is set to true and the programmer uses field from > the variant part which is declared in the false section, should there > be a run time error or not? No. No checking is performed on this. > Although it will be slowly should the compiler check

[fpc-pascal] more Variant thoughts (was: Variant record types in Sockates unit)

2006-10-04 Thread Alexander Todorov
I made the simple test below: program project1; {$ifdef fpc} {$mode objfpc}{$H+} {$endif} {$apptype console} type TTagVariant = record AlwaysThere : Integer; case Flag : Boolean of false: (false_1, false_2 : Byte); true : (true_1: Word); end; var V : TTagVariant; beg

[fpc-pascal] Variant record types in Sockates unit.

2006-10-04 Thread Alexander Todorov
Hello list, I notice the following in socketsh.inc: TInetSockAddr = packed Record case boolean of false : ( {$ifdef SOCK_HAS_SINLEN} sin_len : cuchar; {$endif} sin_family : sa_family_t; sin_port: cushort; sin_addr: in_addr; xpad : array [0..7] of

[fpc-pascal] Re: TProcess questions

2006-10-03 Thread Alexander Todorov
Adrian Maier wrote: It seems nice to have a way of specifying parameters like that (in which case I assume that strings given will be passed as-they-are). Another option is to use escaping for quote characters (and maybe some others) when specifying the TProcess.CommandLine property. __

[fpc-pascal] Re: TProcess questions

2006-10-03 Thread Alexander Todorov
Marco van de Voort wrote: > Can you add the following to TProcess instead of using the CommandLine property: > example: > property ProcessName: String - the process to be executed > property Params : TStringList - list of command line params to be > passed to the process > > Why should quote ch

[fpc-pascal] Re: TProcess questions

2006-10-03 Thread Alexander Todorov
Can you add the following to TProcess instead of using the CommandLine property: example: property ProcessName: String - the process to be executed property Params : TStringList - list of command line params to be passed to the process Why should quote characters be stripped as it is in the curre