Re: [fpc-pascal] using mtprocs

2013-04-18 Thread Mattias Gaertner
On Fri, 19 Apr 2013 00:39:03 +0100 John Lee wrote: > Thanks - however, my attempt to modify the test program by adding the exec > as below so it works in 'parallel' with the main program doesn't work, so I > must have missed something. What does not work? > program Test; > {$mode objfpc}{$H+}

Re: [fpc-pascal] string memory management

2013-04-18 Thread Flávio Etrusco
On Fri, Apr 19, 2013 at 1:36 AM, Xiangrong Fang wrote: > Hi All, > > I'm studying how pascal manages strings. I wrote a simple test program: > > program stringtest; > {$mode objfpc}{$H+} > uses Classes, sysutils; > function test: PString; > var > s : string; > begin > New(Result); > Result^

[fpc-pascal] string memory management

2013-04-18 Thread Xiangrong Fang
Hi All, I'm studying how pascal manages strings. I wrote a simple test program: program stringtest; {$mode objfpc}{$H+} uses Classes, sysutils; function test: PString; var s : string; begin New(Result); Result^ := FloatToStr(Random); // s := FloatToStr(Random); // Result := @s; end; var

Re: [fpc-pascal] How can retrive value from OUT parameter?

2013-04-18 Thread dmitry boyarintsev
Hello Toru, Not sure if it works with SQLdb or ADO, but it has been working for some other tasks that I've been involved with (not FPC, but delphi based, though). You can have the result as through the select statement. Have a TSQLQuery to run the following query: SET NOCOUNT ON declare @var1 in

Re: [fpc-pascal] using mtprocs

2013-04-18 Thread John Lee
Thanks - however, my attempt to modify the test program by adding the exec as below so it works in 'parallel' with the main program doesn't work, so I must have missed something. program Test; {$mode objfpc}{$H+} uses windows,classes, dos, crt, sysutils,MTProcs; var j:longint; // a simple parall

Re: [fpc-pascal] compiling mtprocs

2013-04-18 Thread Mattias Gaertner
On Fri, 19 Apr 2013 00:14:56 +0100 John Lee wrote: > > mtprocs.pas(344,16) Error: No member is provided to access property > > > > mtprocs.pas(880) Fatal: There were 1 errors compiling module, stopping > > > Fatal: Compilation aborted > > > > > > line 344 is: CurrentThread:=Self; > > > > I fixed

Re: [fpc-pascal] compiling mtprocs

2013-04-18 Thread John Lee
> mtprocs.pas(344,16) Error: No member is provided to access property > > mtprocs.pas(880) Fatal: There were 1 errors compiling module, stopping > > Fatal: Compilation aborted > > > > line 344 is: CurrentThread:=Self; > > I fixed that in 40846. > The fix was already in the lazarus-ccr version. > >

Re: [fpc-pascal] compiling mtprocs

2013-04-18 Thread Mattias Gaertner
On Thu, 18 Apr 2013 22:11:11 +0100 John Lee wrote: > Got mtprocs from lazurus svn, compiles ok with win 2.6.2 but not with 2.7.1 > > 2.7.1-r1:23421 [2013/01/18]--Free Pascal Compiler version 2.7.1-r1:23421 > [2013/01/18] for i386 > Copyright (c) 1993-2012 by Florian Klaempfl and others > Target

Re: [fpc-pascal] using mtprocs

2013-04-18 Thread Mattias Gaertner
On Thu, 18 Apr 2013 21:46:23 +0100 John Lee wrote: > I have a program that captures xml data every 2-6 secs from a power sensor, > win , xp. Would like to use freearc ebvery minute or so to compress the > previous data in parallel w/o stopping the capture. Running arc from cmd > line using exec e

[fpc-pascal] compiling mtprocs

2013-04-18 Thread John Lee
Got mtprocs from lazurus svn, compiles ok with win 2.6.2 but not with 2.7.1 2.7.1-r1:23421 [2013/01/18]--Free Pascal Compiler version 2.7.1-r1:23421 [2013/01/18] for i386 Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Win32 for i386 Compiling mtprocs.pas mtprocs.pas(344,16) Err

[fpc-pascal] using mtprocs

2013-04-18 Thread John Lee
I have a program that captures xml data every 2-6 secs from a power sensor, win , xp. Would like to use freearc ebvery minute or so to compress the previous data in parallel w/o stopping the capture. Running arc from cmd line using exec eg exec('/c arc.exe outfile infile'); The compression may take

Re: [fpc-pascal] How to use TThread?

2013-04-18 Thread silvioprog
2013/4/18 Jeppe Græsdal Johansen > Den 18-04-2013 07:03, silvioprog skrev: > > Hi, > > I tried to use TThread in a small sample, but it don't works. The code > is very simple, and I'm sending it in attached. > > Thanks, > > -- > Silvio Clécio > My public projects - github.com/silvioprog > >

Re: [fpc-pascal] How to use TThread?

2013-04-18 Thread silvioprog
2013/4/18 Antonio Fortuny > First of all change the order of lines 25-26 > inherited Create(False); > FreeOnTerminate := True; > > instead of > FreeOnTerminate := True; > inherited Create(False); > > The, drop the DoExecute procedure and replace it by the Execute procedure. > It

Re: [fpc-pascal] why connect is "deprecated"

2013-04-18 Thread Tomas Hajny
On Thu, April 18, 2013 13:46, Marco van de Voort wrote: > In our previous episode, Jonas Maebe said: . . >> > That would also make it possible to directly map socketerror to >> > getlastresult/fpgeterrno, instead of caching it in another threadvar. >> >> IIRC the problem with removing socketerror

[fpc-pascal] Yet again Objects auto destruction

2013-04-18 Thread Zaher Dirkey
I think it is not the first time this topic was opened, but still think we need when using object to have automatically destructor called by compiler when the object freed TmyObject = object FSQL: TStringList; constructor Init(SQL: string); destructor Free; end; constructor TmyObject.Ini

Re: [fpc-pascal] why connect is "deprecated"

2013-04-18 Thread Marco van de Voort
In our previous episode, Jonas Maebe said: > > sb > > wants to support and modernize them, I have no problem with that. > > But that > > hasn't happened since 2005-2007 or so. The modernize bit above also refers to the changes done during the 2.0 RTL update, the functions still have a 1.0.x sig

Re: [fpc-pascal] TBufDataset error

2013-04-18 Thread Antonio Fortuny
Le 18/04/2013 09:59, Michael Van Canneyt a écrit : You should fill in fielddefs, not TFields. 1. Done. All fields defined in FieldDefs. Link a Datasource to the BufDataset and link a TDBGrid to the Datasource. In the IDE, set BufDataset.Active to true. Grid columns color changes, BufDataset l

Re: [fpc-pascal] TBufDataset error

2013-04-18 Thread Michael Van Canneyt
On Thu, 18 Apr 2013, Antonio Fortuny wrote: Hi Guys. Got something funny using the TBufDataSet FCL component. One is dropped onto a TForm. I fill in some TFields (double click on the component image) and give them a name, datatype, size. You should fill in fielddefs, not TFields. After you

[fpc-pascal] TBufDataset error

2013-04-18 Thread Antonio Fortuny
Hi Guys. Got something funny using the TBufDataSet FCL component. One is dropped onto a TForm. I fill in some TFields (double click on the component image) and give them a name, datatype, size. When I try to open I get the funny message:Missing (compatible) underlying dataset, cannot open

Re: [fpc-pascal] How to use TThread?

2013-04-18 Thread Michael Van Canneyt
On Thu, 18 Apr 2013, Jeppe Græsdal Johansen wrote: Den 18-04-2013 07:03, silvioprog skrev: Hi, I tried to use TThread in a small sample, but it don't works. The code is very simple, and I'm sending it in attached. Thanks, -- Silvio Clécio My public projects - github.com/silvioprog He

Re: [fpc-pascal] How to use TThread?

2013-04-18 Thread Jeppe Græsdal Johansen
Den 18-04-2013 07:03, silvioprog skrev: Hi, I tried to use TThread in a small sample, but it don't works. The code is very simple, and I'm sending it in attached. Thanks, -- Silvio Clécio My public projects - github.com/silvioprog Here's a version which I thin