Re: [fpc-pascal] red( clGrayText)

2014-12-02 Thread Philippe
 

Em 01.12.2014 22:42, Mattias Gaertner escreveu: 

 On Mon, 01 Dec
2014 22:01:15 -0200
 Philippe phili...@quarta.com.br wrote:
 

[...] http://wiki.lazarus.freepascal.org/Colors#System_colors [1][1] 


 I have seen it ... but did not catch that it may not work
 with
red( x) ... making it more simple, it means that the range of values
used for those constants as clGrayText is not TColor compatible. Is that
correct?
 
 clGrayText is a TColor, but TColor is not always a simple
RGB value.
 System colors are context sensitive.
 You might try
 

Red(ColorToRGB(clGrayText));
 
 Mattias
 
 working fine !
 Thank
you.
 
 ___
 fpc-pascal
maillist - fpc-pascal@lists.freepascal.org

http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal [2]




Links:
--
[1]
http://wiki.lazarus.freepascal.org/Colors#System_colors
[2]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] findfirst wildcards...

2014-12-02 Thread waldo kitty


how do you process for multiple filemasks?

eg: find ts??.sel and t???.sel for the same processing run


== snip filemask.pas ==
Program Filemasks;

Uses
  SysUtils, StrUtils, Classes;

var
  dirSR : TSearchRec;
  flist : TStringList;
  fmask : string;

begin
  if paramstr(1)  '' then
begin
  fmask := paramstr(1);
  writeln('looking for files that match '+fmask+'');
  writeln;
  flist := TStringList.Create;
//  try
flist.Sorted := False;
flist.Duplicates := dupIgnore;
flist.CaseSensitive := False;
if FindFirst(fmask,faAnyFile,dirSR) = 0 then
  begin
repeat
  flist.Add(dirSR.name);
  writeln(PadRight(IntToStr(flist.count),6) + ' ' + 
flist.Strings[flist.count-1]);

until FindNext(dirSR)  0;
{$IFDEF FPC}
findclose(dirSR);
{$ENDIF}
  end;
writeln;
writeln(PadRight('found ' + IntToStr(flist.count),5) + ' files matching 
'+fmask+'');

//  finally
//if assigned(flist) then
//  freeandnil(flist);
//  end;
end
  else
writeln('please specify a file mask - eg: *.foo');
end.
== snip ==

as seen above, i also attempted to use try...finally in the above but fpc always 
complained about the next line...


Free Pascal Compiler version 2.6.4 [2014/03/02] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: OS/2
Compiling filemask.pas
filemask.pas(19,9) Error: Identifier not found try
filemask.pas(19,9) Fatal: Syntax error, ; expected but identifier FLIST 
found
Fatal: Compilation aborted
Error: X:\FP\2.6.4\BIN\OS2\ppc386.exe returned an error exitcode (normal if you 
did not specify a source file to be compiled)


what am i missing?? i've never really used this capability before...

--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] findfirst wildcards...

2014-12-02 Thread Bart
On 12/2/14, waldo kitty wkitt...@windstream.net wrote:

 how do you process for multiple filemasks?

 eg: find ts??.sel and t???.sel for the same processing run

Maybe I misunderstand the question but:
Use '*' as mask for FindFirst/FindNext then use MatchesMaskList()?

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


Re: [fpc-pascal] findfirst wildcards...

2014-12-02 Thread waldo kitty

On 12/2/2014 5:12 PM, Bart wrote:

On 12/2/14, waldo kitty wkitt...@windstream.net wrote:


how do you process for multiple filemasks?

eg: find ts??.sel and t???.sel for the same processing run


Maybe I misunderstand the question but:
Use '*' as mask for FindFirst/FindNext then use MatchesMaskList()?


in the above masks, any '*' returns too many unwanted files... after some hours 
of experimenting i finally figured out that using '?' works better but in some 
cases, it can also return unwanted files (shorter filenames) than desired...


i'm not aware of MatchesMaskList but i will hunt it down and see if it helps...

thanks! ;)

--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] findfirst wildcards...

2014-12-02 Thread waldo kitty

On 12/2/2014 5:12 PM, Bart wrote:

On 12/2/14, waldo kitty wkitt...@windstream.net wrote:


how do you process for multiple filemasks?

eg: find ts??.sel and t???.sel for the same processing run


Maybe I misunderstand the question but:
Use '*' as mask for FindFirst/FindNext then use MatchesMaskList()?


i can't find anything that is relevant or easy to understand... everything i've 
found seems to be pointing to lazarus code but i don't have lazarus code 
available on all systems this code will be compiled on :/


--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] findfirst wildcards...

2014-12-02 Thread waldo kitty

On 12/2/2014 5:12 PM, Bart wrote:

On 12/2/14, waldo kitty wkitt...@windstream.net wrote:


how do you process for multiple filemasks?

eg: find ts??.sel and t???.sel for the same processing run


Maybe I misunderstand the question but:
Use '*' as mask for FindFirst/FindNext then use MatchesMaskList()?


can you help me understand the differences in the output of the below program?

given these three filenames: t.txt t1.txt t11.txt

with mask  t?.txt  why does MatchesMaskList not show t.txt and t11.txt like 
plain findfirst?


with mask  t??.txt  why does MatchesMaskList not show t.txt and t1.txt like 
plain findfirst?


am i wrong to expect the output to be the same?

is there a way to have MatchesMaskList work like plain FindFirst routine with 
the addition of handling multiple masks?


i think i'm really only wanting something like MatchesMaskList simply for 
handling multiple masks... i'm undecided on the additional restrictiveness of 
MatchesMaskList but i can see where it could be desirable in some cases...



= snip =
Program Filemask;

Uses
  SysUtils, StrUtils, Classes, Masks;

var
  dirSR : TSearchRec;
  flist : TStringList;
  fmask : string;

begin
  if paramstr(1) = '' then
writeln('please specify a file mask - eg: *.foo')
  else
begin
  fmask := paramstr(1);
  writeln('looking for files that match '+fmask+'');
  writeln;
  flist := TStringList.Create;
  try
flist.Sorted := False;
flist.Duplicates := dupIgnore;
flist.CaseSensitive := False;
writeln('*using FindFirst(fmask,faAnyFile,dirSR)');
if FindFirst(fmask,faAnyFile,dirSR) = 0 then
  begin
repeat
  flist.Add(dirSR.Name);
  writeln(PadRight(IntToStr(flist.count),6) + ' ' + 
flist.Strings[flist.count-1]);

until FindNext(dirSR)  0;
{$IFDEF FPC}
findclose(dirSR);
{$ENDIF}
  end;
writeln;
writeln(PadRight('found ' + IntToStr(flist.count),5) + ' files matching 
'+fmask+'');


flist.Clear;
writeln;

writeln('*using FindFirst(''*'',faAnyFile,dirSR) with MatchesMaskList');
if FindFirst('*',faAnyFile,dirSR) = 0 then
  begin
repeat
  if MatchesMaskList(dirSR.Name,fmask) then
begin
  flist.Add(dirSR.Name);
  writeln(PadRight(IntToStr(flist.count),6) + ' ' + 
flist.Strings[flist.count-1]);

end;
until FindNext(dirSR)  0;
{$IFDEF FPC}
findclose(dirSR);
{$ENDIF}
  end;
writeln;
writeln(PadRight('found ' + IntToStr(flist.count),5) + ' files matching 
'+fmask+'');

  finally
if assigned(flist) then
  freeandnil(flist);
  end;
end;
end.
= snip =


--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] node.js-like system using pascal

2014-12-02 Thread Bee
Hi,

Is there anyone out there making node.js-like system using FreePascal?
Thank you.

Regards,

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