Re: [fpc-pascal] unit

2008-03-17 Thread Tomas Hajny
On Sat, March 15, 2008 12:58, Marco van de Voort wrote:
 Why I can't to run unit - programa say: 'Illegal unit name' I try Fps
 0.9.6and 0.6.4 program versions.

 Units are not runnable, FPC versions before 1.0 are from the 1900s. Maybe
 you mean the version of something else?

 If on Linux, your source file must be either lowercase, or match the
 casing
 in the source.

Isn't Fps one of the third party front-ends for fpc (with completely
independent versioning, of course)?

Tomas


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


[fpc-pascal] RE: fpc-pascal Digest, Vol 43, Issue 21

2008-03-17 Thread Crause, Christo (JC)
 From: Codebue Fabio - P-Soft [EMAIL PROTECTED]
 
 I learn about all your tips... but nothing todo. I try to summarize
 I'm using firebird 2.0.3 in windows vista environment. pudf 
 was compiled
 with fpc 2.0.4 and created with lazarus 0.9.22

Did you upgrade or installed a newer version of Firebird over an older
one?  On my machine I installed a newer version over the older one, and
it installed the new version in a subdirectory under Firebird, but the
old
UDF folder was not removed.  I ended up with the following structure,
which lead me to putting UDF dll's in the wrong folder:

C:\Program Files\Firebird\UDF = old UDF folder, not used by my Firebird
2.0
C:\Program Files\Firebird\Firebird_2_0\UDF = new and correct UDF folder

Note that this situation is specific to the way I upgraded and your
folder
structures may look different.  Just ensure that the UDF folder you are
using is at the same level as the bin folder containing the version you
are running.

Regards,
Christo

NOTICE: Please note that this eMail, and the contents thereof, 
is subject to the standard Sasol eMail legal notice which may be found at: 
http://www.sasol.com/legalnotices   
   

If you cannot access the legal notice through the URL attached and you wish 
to receive a copy thereof please send an eMail to 
[EMAIL PROTECTED]

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


Re: [fpc-pascal] How to initialize a Text variable?

2008-03-17 Thread Tomas Hajny
On Sun, March 16, 2008 12:14, Felipe Monteiro de Carvalho wrote:
 On Sun, Mar 16, 2008 at 8:16 AM, Michael Van Canneyt
 [EMAIL PROTECTED] wrote:
  Assign yyoutput to a dummy stream, which simply skips output.

 Could you explain better how can this be implemented?

 The only think I know about streams is TStream.

I'm not sure if mixing lexlib (which is AFAIK written using procedural TP
style code) with streams is a good idea. Depending on your platform, you
could probably simply assign the text file name of 'NUL' or '/dev/nul'.
Admittedly, I don't know whether this kind of device exists for all
platforms (e.g. Symbian ;-) ).

Tomas


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


RE: [fpc-pascal] How to initialize a Text variable?

2008-03-17 Thread Sam Liddicott
Find the definition of the text type and see that it contains pointers to 
read and write functions.

They need replacing in yor instance to pointers to functions that do nothing.

The original Pascal file access is object oriented after all!

Sam


-Original Message-
From: Tomas Hajny [EMAIL PROTECTED]
Sent: 17 March 2008 07:17
To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] How to initialize a Text variable?

On Sun, March 16, 2008 12:14, Felipe Monteiro de Carvalho wrote:
 On Sun, Mar 16, 2008 at 8:16 AM, Michael Van Canneyt
 [EMAIL PROTECTED] wrote:
  Assign yyoutput to a dummy stream, which simply skips output.

 Could you explain better how can this be implemented?

 The only think I know about streams is TStream.

I'm not sure if mixing lexlib (which is AFAIK written using procedural TP
style code) with streams is a good idea. Depending on your platform, you
could probably simply assign the text file name of 'NUL' or '/dev/nul'.
Admittedly, I don't know whether this kind of device exists for all
platforms (e.g. Symbian ;-) ).

Tomas


___
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] Looking for a increment time function

2008-03-17 Thread Graeme Geldenhuys
On 17/03/2008, ik [EMAIL PROTECTED] wrote:
 sorry dateutils.pp


Idiot me, I also never thought that TDateTime's time portion is
milliseconds from midnight. I could have calculated 30 minutes in
milliseconds and keep adding that to the time portion of TDateTime.

But IncMinute() is so much easier! ;-)  Thanks again!

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] Looking for a increment time function

2008-03-17 Thread ik
Yes, look at dates.pp :)

Ido

On Mon, Mar 17, 2008 at 11:43 AM, Graeme Geldenhuys
[EMAIL PROTECTED] wrote:
 Hi,

  Does FPC contain a increment time function?  Something like IncMonth().

  I know I can use DocodeDate/EncodeDate, but that seems such an
  inefficient way of doing it.

  Basically I want to increment the time by 15 or 30 minutes to populate
  rows in a grid.


  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




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


Re: [fpc-pascal] Looking for a increment time function

2008-03-17 Thread Rainer Stratmann
Hello Graeme,

may be this is interisting for you...

ger_timeoutreset - resets the timer
ger_timeoutget_usec - gets µsec's after resetting

regards
Rainer

var
 global_gertv:timeval;
 global_gertvold:timeval;

const
 secusec:=100;

procedure ger_timeoutreset;
begin
 fpgettimeofday(@global_gertv,@global_timezone);
 global_gertvold:=global_gertv;
end;

function ger_timeoutget_usec:longint;
begin
 fpgettimeofday(@global_gertv,@global_timezone);
 if global_gertvold.tv_sec=global_gertv.tv_sec then begin
  ger_toutcount_usec:=ger_toutcount_usec+(global_gertv.tv_usec - 
global_gertvold.tv_usec)
 end
 else begin
  ger_toutcount_usec:=ger_toutcount_usec
  +(secusec - global_gertvold.tv_usec + global_gertv.tv_usec)
  +(global_gertv.tv_sec - global_gertvold.tv_sec - 1) * secusec;
 end;
 if ger_toutcount_usec0 then ger_toutcount_usec:=0;
 global_gertvold:=global_gertv;
 result:=ger_toutcount_usec;
end;


Am Montag, 17. März 2008 10:54 schrieb Graeme Geldenhuys:
 On 17/03/2008, ik [EMAIL PROTECTED] wrote:
  sorry dateutils.pp

 Idiot me, I also never thought that TDateTime's time portion is
 milliseconds from midnight. I could have calculated 30 minutes in
 milliseconds and keep adding that to the time portion of TDateTime.

 But IncMinute() is so much easier! ;-)  Thanks again!

 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
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Firebird UDF

2008-03-17 Thread zaher dirkey
May be you UDF depend on external library try to View Dependency.

On Sat, Mar 15, 2008 at 4:05 PM, Stephano [EMAIL PROTECTED] wrote:

  nothing todo...
  ok restart:
  library pudf;
 
  {$mode objfpc}{$H+}
 
  uses
Classes,
p_func in 'p_func.pas';
 
  exports
pround name 'p_round';
 
  {$R pudf.res}
 
  begin
 
  //  DECLARE EXTERNAL FUNCTION pround
  //   DOUBLE PRECISION, INTEGER
  //   RETURNS DOUBLE PRECISION BY VALUE
  //  ENTRY_POINT 'pudf_pround'  MODULE_NAME 'pudf';
 
  end.
 
  and
 
  unit p_func;
 
  {$mode objfpc}{$H+}
 
  interface
function p_round(var valore: double; ndec: integer): double; cdecl;
 
  implementation
 
  uses
Classes, SysUtils;
 
  function p_round(var valore: double; ndec: integer): double; cdecl;
  var
i: integer;
risultato: double;
ndivisore: integer;
  begin
 
risultato:= valore;
ndivisore:= 1;
for i:= 1 to ndec do
begin
  risultato:= risultato*10;
  ndivisore:= ndivisore*10;
end;
 
result:= round(risultato)/ndivisore;
  end;
  end.
 
  someone can compile and install?
 
  I can... but when I try to execute
 
  select round(123.1233, 2) as nrounded from rdb$database
 
  always some error!!!

 - Entry point should be p_round only in this case

 - Adding also 'export' in the function declaration should help:

 function p_round(var valore: double; ndec: integer): double; cdecl;
 export;

 - The following needs to be corrected as well:
 exports p_round name 'p_round';
 _^
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal




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

Re: [fpc-pascal] Looking for a increment time function

2008-03-17 Thread Rainer Stratmann
+
var
 global_timezone:timezone;


Am Montag, 17. März 2008 10:54 schrieb Graeme Geldenhuys:
 On 17/03/2008, ik [EMAIL PROTECTED] wrote:
  sorry dateutils.pp

 Idiot me, I also never thought that TDateTime's time portion is
 milliseconds from midnight. I could have calculated 30 minutes in
 milliseconds and keep adding that to the time portion of TDateTime.

 But IncMinute() is so much easier! ;-)  Thanks again!

 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
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Looking for a increment time function

2008-03-17 Thread ik
sorry dateutils.pp

On Mon, Mar 17, 2008 at 11:45 AM, ik [EMAIL PROTECTED] wrote:
 Yes, look at dates.pp :)

  Ido



  On Mon, Mar 17, 2008 at 11:43 AM, Graeme Geldenhuys
  [EMAIL PROTECTED] wrote:
   Hi,
  
Does FPC contain a increment time function?  Something like IncMonth().
  
I know I can use DocodeDate/EncodeDate, but that seems such an
inefficient way of doing it.
  
Basically I want to increment the time by 15 or 30 minutes to populate
rows in a grid.
  
  
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
  



  --
  http://ik.homelinux.org/




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


[fpc-pascal] Looking for a increment time function

2008-03-17 Thread Graeme Geldenhuys
Hi,

Does FPC contain a increment time function?  Something like IncMonth().

I know I can use DocodeDate/EncodeDate, but that seems such an
inefficient way of doing it.

Basically I want to increment the time by 15 or 30 minutes to populate
rows in a grid.


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


[fpc-pascal] unit system;  procedure move();

2008-03-17 Thread fpc
Hi

I need more informations about the move() procedure  form unit system.
I want to shift an array (values:array[0..Maximum-1] of single) like the 
following lines:

for i:=Maximum-1 downto 1 do values[i]:=values[i-1];
values[0]:=sameothervalue;

I found the move procedure (unit system) and wrote this lines:

move(values[0],values[1],Maximum*sizeof(single));
values[0]:=sameothervalue;

I would use the move procedure, because the move procedure is very quickly.
The program runs very well with move, but I would avoid access violations in 
future. That are the reasons of my questions:
Is the use of the move procedure right? The array length is Maximum-1. When I 
put this length on value[1], the last entry value[Maximum-1] would be deleted 
or would be shifted in an different memory area? What happens with the last 
entry value[Maximum-1]?

Thank you.

Regards,
Markus

-- 
FreePascal Mailing List:
fpc-pascal@lists.freepascal.org


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


Re: [fpc-pascal] unit system;  procedure move ();

2008-03-17 Thread Jonas Maebe


On 17 Mar 2008, at 12:34, [EMAIL PROTECTED] wrote:


I need more informations about the move() procedure  form unit system.
I want to shift an array (values:array[0..Maximum-1] of single) like  
the

following lines:

for i:=Maximum-1 downto 1 do values[i]:=values[i-1];
values[0]:=sameothervalue;

I found the move procedure (unit system) and wrote this lines:

move(values[0],values[1],Maximum*sizeof(single));
values[0]:=sameothervalue;

I would use the move procedure, because the move procedure is very  
quickly.
The program runs very well with move, but I would avoid access  
violations in

future. That are the reasons of my questions:
Is the use of the move procedure right? The array length is  
Maximum-1. When I
put this length on value[1], the last entry value[Maximum-1] would  
be deleted

or would be shifted in an different memory area?


It would overwrite whatever is placed in memory after the array  
(which, in case there is nothing, indeed causes an access violation).  
Use this instead:

move(values[0],values[1],(Maximum-1)*sizeof(single));
values[0]:=sameothervalue;

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


[fpc-pascal] transparent windows on X11

2008-03-17 Thread Graeme Geldenhuys
Hi,

Anybody know how to use Xlib API to create transparent windows?  This
is for use with fpGUI Toolkit. For example. I have a Label component
(which is actually a mini window) and have to always specify and paint
a background color. If I don't, I see all kinds of rubbish as the
background.

I want to place the Label component/window on another window (Form),
and only want to see the text of the label. The background window must
show through.  Any ideas?


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] transparent windows on X11

2008-03-17 Thread Eduardo Morras

At 15:17 17/03/2008, you wrote:


Hi,

Anybody know how to use Xlib API to create transparent windows?  This
is for use with fpGUI Toolkit. For example. I have a Label component
(which is actually a mini window) and have to always specify and paint
a background color. If I don't, I see all kinds of rubbish as the
background.


I never programmed under X system but perhaps you search this for?

http://lists.freedesktop.org/pipermail/xorg/2005-October/010877.html


I want to place the Label component/window on another window (Form),
and only want to see the text of the label. The background window must
show through.  Any ideas?


Don't know sorry



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


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


Re: [fpc-pascal] transparent windows on X11

2008-03-17 Thread ik
Copy paste from : http://www.faqs.org/faqs/x-faq/part7/
Subject: 175)  How do I create a transparent window?

A completely transparent window is easy to get -- use an InputOnly
window. In order to create a window which is *mostly* transparent, you have
several choices:
- the SHAPE extension first released with X11R4 offers an easy way to
make non-rectangular windows, so you can set the shape of the window to fit the
areas where the window should be nontransparent; however, not all servers
support the extension.
- a machine-specific method of implementing transparent windows for
particular servers is to use an overlay plane supported by the hardware.  Note
that there is no X notion of a transparent color index.
- a generally portable solution is to use a large number of tiny
windows, but this makes operating on the application as a unit difficult.
- a final answer is to consider whether you really need a transparent
window or if you would be satisfied with being able to overlay your application
window with information; if so, you can draw into separate bitplanes in colors
that will appear properly.

[thanks to der Mouse, [EMAIL PROTECTED], 3/92; see also
The X Journal 1:4 for a more complete answer, including code samples for this
last option]


On Mon, Mar 17, 2008 at 4:17 PM, Graeme Geldenhuys
[EMAIL PROTECTED] wrote:
 Hi,

  Anybody know how to use Xlib API to create transparent windows?  This
  is for use with fpGUI Toolkit. For example. I have a Label component
  (which is actually a mini window) and have to always specify and paint
  a background color. If I don't, I see all kinds of rubbish as the
  background.

  I want to place the Label component/window on another window (Form),
  and only want to see the text of the label. The background window must
  show through.  Any ideas?


  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




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


Re: [fpc-pascal] unit system;  procedure move();

2008-03-17 Thread Pete Cervasio
On Monday 17 March 2008 06:40:51 Jonas Maebe wrote:
 On 17 Mar 2008, at 12:34, [EMAIL PROTECTED] wrote:
  Is the use of the move procedure right? The array length is
  Maximum-1. When I
  put this length on value[1], the last entry value[Maximum-1] would
  be deleted
  or would be shifted in an different memory area?

 It would overwrite whatever is placed in memory after the array
 (which, in case there is nothing, indeed causes an access violation).
 Use this instead:
 move(values[0],values[1],(Maximum-1)*sizeof(single));
 values[0]:=sameothervalue;

Wouldn't it be better to use the length function on the array?  Or does that 
not work in some compiler modes?

move(values[0], values[1], (length(values)-1) * sizeof(single));

If the size of the array is ever changed, no code change is required.

Best regards,
Pete C.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal