En/na L ha escrit:
Many functions should be merged into an FPC rtl unit I suppose, since it appears
many of us are reinventing the wheel each time rolling our own private units.
It's amazing the amount of extremely useful types/classes/functions
available out of the box, but they are virtuall
Marc Santhoff wrote:
> Hi,
>
> is there any function in the libraries of fpc for splitting a string
> into an array naming the separator?
There is a function in the substrings.pas unit included in this
package:
http://z505.com/cgi-bin/powtils/docs/1.6/idx.cgi?file=substrsplit&unit=substrings
And
Sorry for all of these replies, I think my ISP (webhost) is working on
their mail servers.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Am Dienstag, den 10.07.2007, 14:56 +0200 schrieb Andrea Mauri:
> I used this, check it.
>
> // Returns an array with the parts of "str" separated by "separator"
> function Split(const str: string; const separator: string): array of string;
> var
> i, n: integer;
> strline, strfield: string;
>
On Tuesday 10 July 2007 13.00, Marc Santhoff wrote:
> Hi,
>
> is there any function in the libraries of fpc for splitting a string
> into an array naming the separator?
>
Procedure splitstring from MSEgui, file lib/common/kernel/msestrings.pas.
http://www.homepage.bluewin.ch/msegui/
Martin
_
Disregard my prior post, it is Delphi specific. I did find this one.
(http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/components/printers/samples/rawmode/unitmain.pas?root=lazarus&rev=10129&view=markup)
procedure WritePrinter;
var
sTemp: String;
Written: Integer;
begin
Written := 0;
sTe
Disregard my prior post. It does not work unless the Windows Spooler
API is converted.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Disregard my prior post. It does not work unless the Windows Spooler
API is converted.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
occurs is:
function Occurs(const str, separator: string): integer;
var
i, nSep: integer;
begin
nSep:= 0;
for i:= 1 to Length(str) do
if str[i] = separator then Inc(nSep);
Result:= nSep;
end;
Andrea Mauri ha scritto:
I used this, check it.
// Returns an array with the parts of "str" sepa
Since you specify LPT1:, I assume you are using Windows. Obviously the
solution for Linux would be different than Windows. I am not quite sure
about FPC, but in Delphi you basically have two choices.
1) Capture the USB printer to an LPT port, then attempt assign(printer,
'LPTx:'); (not a go
I used this, check it.
// Returns an array with the parts of "str" separated by "separator"
function Split(const str: string; const separator: string): array of string;
var
i, n: integer;
strline, strfield: string;
begin
n:= Occurs(str, separator);
SetLength(Result, n + 1);
i := 0;
strline:
Here is a Delphi implementation of the common PHP function 'explode'.
http://www.michael-puff.de/Developer/Delphi/Code-Snippets/Explode.html
Your example then becomes to
..
A := Explode('-', 'ab-cd-ef');
writeln(A[1]); // expect 'cd'
..
The inverse is accomplished by using PHP like 'implode', wh
I'm a delphi programmer.
I'm printing a report using:
assign(wPrinter,'Lpt1:')
and it goes ok in paralel priner.
I did assign(wPrinter,'USB001') and it did not work.
Do you know how to print in USB printers?
I thanks a lot if you can help me.
Roberto Barreiro
Recife, Brazil
Ro
Am Dienstag, den 10.07.2007, 13:17 +0200 schrieb Luca Olivetti:
> En/na Marc Santhoff ha escrit:
> > Hi,
> >
> > is there any function in the libraries of fpc for splitting a string
> > into an array naming the separator?
>
> not exactly but I found:
>
> http://www.freepascal.org/docs-html/rtl/s
Op Tue, 10 Jul 2007, schreef Marc Santhoff:
> Hi,
>
> is there any function in the libraries of fpc for splitting a string
> into an array naming the separator?
>
> In awk for eample if you do this:
>
> split("ab-cd-ef", x, "-")
> print x[2]
>
> it would split up the first string
En/na Marc Santhoff ha escrit:
Hi,
is there any function in the libraries of fpc for splitting a string
into an array naming the separator?
not exactly but I found:
http://www.freepascal.org/docs-html/rtl/strutils/extractdelimited.html
maybe exactly what you're searching is already there, s
Hi,
is there any function in the libraries of fpc for splitting a string
into an array naming the separator?
In awk for eample if you do this:
split("ab-cd-ef", x, "-")
print x[2]
it would split up the first string using "-" as separator and print
cd
to the output. Tha
On Tue, 10 Jul 2007, ik wrote:
> On 7/9/07, Alain Michaud <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > last year I have written a very small driver using the "char" model,
> > ie. that is put in src/linux/drivers/char something very simple to
> > read/write a few bytes on an output port. I would
On 7/9/07, Alain Michaud <[EMAIL PROTECTED]> wrote:
Hi,
last year I have written a very small driver using the "char" model,
ie. that is put in src/linux/drivers/char something very simple to
read/write a few bytes on an output port. I would have been glad to
write it in pascal, but I do not t
19 matches
Mail list logo