[fpc-pascal] Should Insert+Edit Fields+Insert again on a TDataSet work?

2007-11-24 Thread Felipe Monteiro de Carvalho
Hi,

Please take a look at the following discussion on this bug report:

http://www.freepascal.org/mantis/view.php?id=10165

The question is very simple. Suppose a trivial data-aware application
with a DBNavigator and a number of DBEdits. The following steps:

1 - Click insert on the DBNavigator

2 - Add some text to the DBEdits

3 - Click insert again on the DBNavigator

Now, what should happen? Should the first inserted record be persisted or lost?

I don't know how to use any other database method on my TurboDelphi
except ADO, and there this works.

Does anyone know if this should actually work, or if this just works
with ADO and shouldn't work with any other dataset?

The question is relevant to fpc because some fpc datasets don't allow
the 3 steps above and I already saw the data be inserted in the wrong
order, or even simply lost.

thanks,
-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Should Insert+Edit Fields+Insert again on a TDataSet work?

2007-11-24 Thread Felipe Monteiro de Carvalho
Ok, so I managed to get a DBE application working and it has the same
behavior as the ADO one.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Should Insert+Edit Fields+Insert again on a TDataSet work?

2007-11-24 Thread John & Marg Sunderland

Felipe Monteiro de Carvalho wrote:

Ok, so I managed to get a DBE application working and it has the same
behavior as the ADO one.

  
I believe it should be posted (kept).   In general, at least in Delphi - 
I think throughout the Borland world - if you navigate off a record you 
have inserted or edited, the edited record is posted.  I think inserting 
another record is just another way of navigating off the edited record.


cheers,
John Sunderland
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] binstr for single type

2007-11-24 Thread Krekan
Hello, I need a routine binstr(var val:single;,) since no such in the rtl 
exists I decided to write one. Also I wanted to make reverse routine bin2float 
where the input would be string containing 32 ones and zeroes. But I didn't 
want to bother with extracting mantissa, exponent, shifting adding dropped 
zero... One idea is to move entire singlenumber to the buffer (array of four 
bytes) and then I have values of 4 bytes allready figured so I can convert them 
to binary or in reverse convert 32 binary digits to  4 bytes and move them back 
to single. This approach worked until I used this on single numbers without 
floating part. But when I gave number with floating part it appended some 
numbers after my number.
Following code snippet demonstrates the idea.
If someone could point me what I am doing wrong there I would be gratefull.
program testsingle;
var number:single;
buf:array[1..4] of byte;
i:byte;
begin
writeln('enter float number ');
readln(number);
writeln('you entered: ',number);
move(number,buf,sizeof(number));
writeln('memory dump - byte by byte from left to right :');
for i:=1 to 4 do write(buf[i],' ');
move(buf,number,sizeof(number));
writeln;
writeln('result ');
writeln(number:0:6);
end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Lazarus + Qt4 in FreeBSD

2007-11-24 Thread Den Jean
On Thursday 22 November 2007 04:50:59 pm [EMAIL PROTECTED] wrote:
> Qt 4.3.1 is installed from ports and my Lazarus snapshot verion 0.9.25 of
> 22-nov-2007...

probably because the linker does not find libqt4intf.so.
I have so bsd experience. Are you interested in 
creating a libqt4intf.so for bsd :-). ?
if so start from the linux source code and compile script.

kind regards,

Den Jean


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] IPC/SHMGET and Multiple Variables

2007-11-24 Thread T.Guilleminot

Hi

I want to use IPC Shared Memory mecanism to enable communication between 
Linux processes. I followed doc example 
(http://community.freepascal.org:1/docs-html/rtl/ipc/shmctl) which 
works fine.
However I'm unable to find how the handle multiple variables (or may be 
an array).

Should I have to open as many shared segments as variables ?
Or may be store all into my single segment but with a separator character ?
What would you recommend ?

Thanks !
Tom
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] HOW TO, PROBLEM read stdin (linux) ??

2007-11-24 Thread TOUZEAU DAVID

Dear

What is the best way to read into a memory datas from this command.


"/bin/myprogram end. 




--
David Touzeau -- Linux Ubuntu 7.04 feisty 
FreePascal-Lazarus,perl,delphi,php artica for postfix management console 
(http://www.artica.fr) icq:160018849

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Should Insert+Edit Fields+Insert again on a TDataSet work?

2007-11-24 Thread Graeme Geldenhuys
On 24/11/2007, Felipe Monteiro de Carvalho
<[EMAIL PROTECTED]> wrote:
> Ok, so I managed to get a DBE application working and it has the same
> behavior as the ADO one.
>

>From my Delphi days, what I remember is that the data gets saved
(posted) as soon as you move to another record.  Using your example
with the DBNavigator, doing another insert, moves to a new record, so
the old record must be posted (saved).


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] HOW TO, PROBLEM read stdin (linux) ??

2007-11-24 Thread TOUZEAU DAVID

Great many thanks

Wanderlan Santos dos Anjos a écrit :

program yourprogram;

{$mode objfpc}{$H+}

uses
 Classes, SysUtils;
var
 st: text;
 s: string;
begin
 assign(st,'');
 reset(st);
 while not eof(st) do begin // --- iterate while not en of file
   readln(st,s); //<<< read only a line
   writeln(s);
 end;
 close(st); // <---
end.


--
Att,

Wanderlan Santos dos Anjos

On Nov 24, 2007 8:15 AM, TOUZEAU DAVID <[EMAIL PROTECTED] 
> wrote:


Dear

What is the best way to read into a memory datas from this command.


"/bin/myprogram http://www.artica.fr) icq:160018849
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org

http://lists.freepascal.org/mailman/listinfo/fpc-pascal






--

   * 01.41.39.04.42
   * 06.20.56.74.33
   * ICQ:160018849
   * Skype:dtouzeau

   * Site technique destiné aux entreprises:
 http://entreprises.kaspersky.fr
   * Inscrivez-vous dès maintenant dans l'espace partenaires !
 

(Retrouvez sur ces sites des faqs, tutoriaux, Forums et liens de 
téléchargement de la gamme Buiness Optimal)







* *




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] How to send stdout pipe to a process ?

2007-11-24 Thread TOUZEAU DAVID

Dear

I would like to send a TStringList.text to an external process (kind of 
stdout)


i have an external process that require to receive datas from stdin

like /home/process1 I would like my program to send datas inserted into a Tstringlist to 
this "process1"


I think i should use "Output" but don't know how ?

Do you think this should be answer ?? Is there a better way ?

For i:=0 to List.Count-1 do begin
   writeln(output;list.Strings[i]);
end;




--
David Touzeau -- Linux Ubuntu 7.04 feisty 
FreePascal-Lazarus,perl,delphi,php artica for postfix management console 
(http://www.artica.fr) icq:160018849

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Should Insert+Edit Fields+Insert again on a TDataSet work?

2007-11-24 Thread Marc Santhoff
Am Samstag, den 24.11.2007, 09:44 +0100 schrieb Felipe Monteiro de
Carvalho:
> Hi,
> 
> Please take a look at the following discussion on this bug report:
> 
> http://www.freepascal.org/mantis/view.php?id=10165
> 
> The question is very simple. Suppose a trivial data-aware application
> with a DBNavigator and a number of DBEdits. The following steps:
> 
> 1 - Click insert on the DBNavigator
> 
> 2 - Add some text to the DBEdits
> 
> 3 - Click insert again on the DBNavigator
> 
> Now, what should happen? Should the first inserted record be persisted or 
> lost?
> 
> I don't know how to use any other database method on my TurboDelphi
> except ADO, and there this works.
> 
> Does anyone know if this should actually work, or if this just works
> with ADO and shouldn't work with any other dataset?
> 
> The question is relevant to fpc because some fpc datasets don't allow
> the 3 steps above and I already saw the data be inserted in the wrong
> order, or even simply lost.

Most Database apps have the idea of an "insert row", that is a fresh new
record created on the "new/insert"-event or when the user navigates
after the last record from the underlying table.

If this insert row record (only existing on the client side) is filled
with at least some data and the user clicks "insert" again the insert
row is posted to the table and emptied, so a second new record is
prepared at the client (not posted yet). But it is only one at a time.

HTH,
Marc


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal