>Hi,
>I'm making an application but to have it work like I want I need to make
>a binding or a wrapper (is there a diiference ?) to some external
>software. Are there documents that can be used to learn how to do this ?
Your proposition is to general for us to help. Almost everything in software i
> It does not work as is on Mac, but then, most people don't care. *cry*
>
I would consider a Mac if they didn't weld them shut like those iMacs. Talk
about
closed source hardware.
Of course for every complaint I make someone will come back with "but you can
buy
Macs with a tower case and
Why is the first and third example *so* much faster than the second example?
Significantly faster.
There's really not that much difference between the string concatenation.
//Example 1: (seems fast)
function StrLoadFile_test1(FileName: string): string;
var
F: text;
c: char;
str1,Line: stri
> Doesn´t the demonstration Quake 2 work?
>
> This is the case for many games, like Doom for Pascal.
I need to test the latest patched Quake 2 v3.21, because the demo is older,
v3.14 I
think.
The game runs on the demo, but it tells me I'm missing a Plaque - or something.
So I
think this is in
Trustmaster sends me this trick/hack (as shown below) to avoid using CMEM in a
dll/dso in order to get ansistrings working through a dll/dso.
Comments? Find anything wrong with it?
i.e. the ability to use strings in a DLL/DSO without ever using Pchars.
Trustmaster's trick/hack:
> Hi Lars,
>
> I
Any way to put a date stamp into a binary that is compiled? I don't see a
predefined
symbol available.
Any ideas or suggestions.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> HI,
>
> FPC is compiled only
>
> Alain
There are some scripting systems out there, RemObjects which I think Boguslaw
was
working on completing the latest version? There is another one that I think
costs
money, and maybe a few on TOrry.net which could be converted from Delphi to FPC.
___
-Fu/home/me/project1/units/*.*
No such thing for FPC, right? Recursive units searches?
Could be useful, but dangerous if directories contain different versions of the
source
file in different places.
Still, in many projects I get sick of continually adding new directories to the
search
path - a
> int testreturn(const char *thename, char *rcity, char *rstate)
> {
>
> memcpy (rcity,"Boston",7);
> memcpy (rstate,"Massachusetts",14);
>
> return strlen(thename);
> }
First thing to check is it declared CDECL or STDCALL in the C library?
> I click OK and its fine. It returns ev
On my debian system I place it anywhere - we haven't decided on an official
location - however
for ease of typing in your fpc.cfg search path or IDE search path it will be
good to place it in
a terse or short directory such as /etc/pwu-1.6.0.0/ instead of something like
/home/joe/web/devel/pwu-1.
Yes I was rally mad when I first discovered the bug after releasing 1.6.0.0, I
was going to
release a 1.6.0.1 which fixed minor glitches like this - but didn't get around
to it yet.
I thought that since Pascal was case insensitive, the path would work - but I
guess it would be
too slow for the
Hello,
Just for your information..
I have created a small video showing a web based FPC compiler in action.
http://z505.com/videos/pwu/webcmd/webcmd-fpc-demo1.htm
The source code to this demo will be posted on Z505.com and the
psp.furtopia.com site soon.
This is the first step in making our w
Dear friends,
I compiled the famous DOOM game with FPC 2.1.4 and it works better now. Had to
make minor syntax
modifications to compile it with 2.1.4.
http://z505.com/cgi-bin/qkcont/qkcont.cgi?p=Doom-To-Freepascal
http://z505.com/pascal/games/doom2fpc-2.1.4.zip
Now compiling with 2.1.4 it seems
Adrian Wrote:> no - that was not the problem. I have my linux running in a
coLinux
> session and it seems that the linker fails, when the file is in a
> windows drive, even as root. other programms don't have problems to read
> or write to this drive.
>
> but there is still a strange problem with
> Adrian Wrote:
> no - that was not the problem. I have my linux running in a coLinux
> > session and it seems that the linker fails, when the file is in a
> > windows drive, even as root. other programms don't have problems to read
> > or write to this drive.
> >
> > but there is still a strange
> I've got a shared library (.so) I wrote in C, with initialization and
> finalization code declared by using the GCC attributes constructor and
> destructor. These init and fini functions simply print out "start" and
> "stop" to stdout. The .so exports one function, which prints out
> "Hello".
>
Test writes:
> I have a source file (test.pp) that uses some units. Where can I get
> those units? If you didn't notice, I am a newbie :)
> I tried to compile but it obviously drops an error.
>
> uses
> cgiapp, unix, unixutils, classes, inifiles
FPC compiler comes with compiled .a/.ppu/.o file
> I know, programs with a writeln() have lower performance, but
> I think, printf() and writeln() must do the same. This need time to
> calculate.
You have to explain problem more.
The key thing to do is find your bottleneck. Write some benchmarks for float to
string conversions
and put them in
> Just trying to compile the 'hiliter' example, I have found 3 problems
> and the last one is a show stopper, so can't continue. And this is
> with the release version of PWU 1.6.0.2 downloaded from SourceForge.
>
> * Tokenizer couldn't compile under Linux. It had syntax errors.
> * PCharUtils unit
Ido wrote:
> I saw an interesting bug on C++, and I was wondering how to solve this
> type of bug in Pascal:
>
> {$MODE OBJFPC}
> program namespace_test;
>
> function test : boolean;
> begin
> result := true;
> end;
>
> type
> TTest = class
> function test : boolean;
> end;
>
> function TTes
> A program doesn't have a namespace that one can access, AFAIK (someone care
> to correct?).
Note to self: Actually it does, as mentioned in another email from IK.
i.e.
program1.test
> var // initialized record
> NameSpace: TNameSpace(test: @test);
I meant:
NameSpace: TNameSpace = (t
Andrew Haines wrote:
> Is there a unit somewhere that can extract links from html pages? I want
> to be able to recursively add pages to a chm archive.
I created a program called GetLinks in a couple minutes:
http://opensvn.csie.org/pspcgi/general-utilities/parser/html/demo/getlinks.pas
Latest ht
> > Is there a unit somewhere that can extract links from html pages? I want
> > to be able to recursively add pages to a chm archive.
>
> I created a program called GetLinks in a couple minutes:
Updated the files and changed the htmlutil functions a bit.
Also, created a recursive example that us
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
> > > Wouldn't this function be a candidate for crawling into the 'strutils'
> > > unit?
> >
> > Probably, but I would change the interface:
> >
> > function Split(const str: string; const separator: string; var Res : array
of
> > string) : Integer;
> >
> > So the function returns the number of ele
http://freepascal.org/contrib/db.php3?category=Miscellaneous
Someone should lock off that section of the website.. temporarily.
It is getting spammed and filling up the database fast.
Maybe just temporarily lock it off and keep the other sections open (i.e. do not
allow posting).
The sections l
Thanks Jonas for cleaning it up, looks much better.
However, what the heck?
I just found another one today:
http://freepascal.org/contrib/delete.php3?ID=2481
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/
> mysqlku.pas(16,18) Error: Identifier not found "TMYSQL"
> mysqlku.pas(16,18) Error: Error in type definition
> mysqlku.pas(18,22) Error: Identifier not found "TMYSQL_ROW"
> mysqlku.pas(18,22) Error: Error in type definition
> mysqlku.pas(74,17) Error: Operator is not overloaded
> mysqlku.pas(76,
> > Hi, I'm trying to start a Win32 process and exit leaving the process
> > executing. The test
> > scenario
> > is a CGI calling a simple Http server (the Synapse Http server demo).
> >I have done this before but it has been months and I forget exactly what I
did.
Something like this below:
pro
> Hi,
>
> Any ideas when (or if) PasWiki will be released to the public? I know
> about the Simple CMS downloads, but don't feel the urge to rewrite it
> into a full fledged wiki server with syntax parsing only to find
> PasWiki already does all that and could be released before I complete
> my wi
> Thanks L, do you know if I ShellExecute can create a process without showing
> the command window?
I'm sure you can hide it.. just a matter of finding the right Windows API
paramaters..
Probably something like..
SW_HIDE
Not teste
> > Thanks L, do you know if I ShellExecute can create a process without showing
> > the command window?
>
> I'm sure you can hide it.. just a matter of finding the right Windows API
> paramaters..
>
> Probably something like..
> SW_HIDEy
>
> Not tested, no
Have you tested this simple way of doing it below
program test; {$mode objfpc} {$H+}
uses windows;
begin
ShellExecute(0 , 'open', 'notepad', nil, nil, SW_SHOWNORMAL) ;
ShellExecute(0 , 'open', 'notepad', nil, nil, SW_HIDE) ;
end.
The cmd /k may not even be needed... and it may not even work t
Graeme wrote:
> I started with a MarkDown syntax parser (mostly code snippets at the
> moment). I'd like to abstract it as a class which can then be used in
> other projects as well. Things like CGI apps or fpdoc's description
> files. eg: Editing the documentation in Lazde (or fpGUI's doceditor)
>
> You cannot do this with a single construct; You need a pointer in the case
> of a dynamically loaded library.
> >
> > I'm not sure that I understand. can you please point me to an example ?
He means it depends on whether you are using:
DLL bound dynamically at program runtime
DLL bound statical
> > If you do on a hand calculator:
> >
> > 1/3
> >
> > ... you will see:
> >
> > 0.333
> >
> > If you multiply again with 3, you will see:
> >
> > 0.999
> >
> > ... and not 1.000.
On my electronic/digital calculator I see '1'
It is a casio fx-300SA
Maybe $5 digita
> Regarding the $3000 computer: An extended has 20 digits of precision.
> Make sure you round your output to 10 digits and you need to a very weird
> calcation until you can see a rounding difference :)
I was talking about $3000 pascal dollars:
BEGIN
writeln($3000);
END.
Output:
12288
The
> >> Also, all those icons in the menus look pretty weird (very few Mac
> >> apps have that, and none that I currently use does),
Also, on Windows I found the spacing was a bit big but not sure if this is
normal MS OFfice style look and feel since I don't use that software much.
For example it lo
> It's just one more funny thing one must realize,
> when comparing real numbers with some exact
> real constants. After this, I will try to never
> compare doubles directly, but using tricks like
> above. Because, in this digital world
> 1 + 0.4 - 0.4 <> 1.
My opinion:
This is ludicrous.
The end
> The programmer definitely should care. He has to make the right choice
> in what type he chooses, so he must be aware of any 'quircks' of the type
> he is using, and that includes how things are rounded and how they are
> stored in memory. That's why there are IEEE references for this.
>
> It's
> Your Casio doesn't do comparisons. Just round to 10 digits before you
> compare and it'll work just as fine as on your Casio.
>
> Daniël
And some off topic trivia:
My casio says "10 + 2 digits" near the model number.
Does this mean it displays 10 digits and stores 2 in the background, or that
> >
> > The end user is using a high level language and should not care whether the
> > computer is digital or analog.
>
> Unfortunately, there is a problem. One can try to hide it (as calculators
> attempt to do), but in the longer run that is going to be unsuccessful
> and even dangerous.
Same
> It means it displays 10 and has 2 additional digits for internal use. As I
> said, the easiest way to check this is to push the pi button and subtract
> the number you see in the display.
> > Probably -4*10-10 :)
Yes, that's what happens on mine.
> > Unfortunatly I don't use calculators that m
> Same as ansistring.. it can be dangerous to hide all the intricate details of
a
> pchar/bytearray, which is what ansistring does. But ansistrings are really
> useful for 'every day' use.
> > Wrong. A string can be represented "alphadequate", as it is called; an
> > ansistring can handle any stri
Here's one: profile your code!
>>> And where can you read how to do that?
VALGRIND
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> I think first code is faster than second, because in first code
> SubCalculate function is in calling function body?
Actually some times local scope functions are slower because the variables need
to be carried around since you are doing somewhat of a lexical closure. The
local scope function
> > P.S. Where i can read tips about writing fast FP code?
Also see some of the fastcode projects:
http://www.fastcode.dk/fastcodeproject/fastcodeproject/index.htm
And I'm sure you know you can always use GOTO statements when you really need
speed out of loops
:)
(not always, only if absolut
> I hear the Intel C compilers and Fortran compilers and Ada compilers are
better
> optimized for certain things since FPC/delphi are generally desinged for GUI
> programming. ;-)
>>
>> C/Fortran yes, Ada no; there exists no Intel Ada compiler. It is also
>> false that FPC is slow because it has be
> If the code is more efficient with a "goto", this is sufficient to
> justify its use.
Or if the code is clearer, for example to avoid deep nesting...
Or to make clean errors and debugging log files easier:
exit; .// default
//else
error1:
begin
debugln('error1');
exit;
end;
error2
begin
> Hi all,
>
> I had never used Perl before. Until someone showed me Perl is very fast
> for text processing (using its powerful regex), despite it's an
> interpreted language. It even beat Delphi and FPC though both are
> compiled language. A few lines Perl program almost two times faster than
> a
> Further, it is unknown how well the GCC backend optimizes Ada
> language constructs as it is primarily designed for the C language.
I assumed that people used not just GNU Ada compilers.. for serious work.
But I'm not sure.
For example, what do Airplanes use? GNU?
I'd laugh if Richard Stallman
> > Well, considering that perl's or Python's speed greatly rely on the
> > underlying C-implementation of (at least) particular functionality, all
> > those comparisons basically boil down to C vs. C, anyway. Or don't
> > they?
>
> Exactly! That's why I prefer to use fpc own regexpr unit. :)
>
> > Word count: 126944
> > Unique word count: 11793
> >
> > real0m0.281s
> > user0m0.244s
> > sys 0m0.016s
>
Can someone do a test for 5 minutes of parsing and see if things slow down or
speed up for one of the programs?
That takes away process load time too..
example: the time it ta
> > > Word count: 126944
> > > Unique word count: 11793
> > >
> > > real0m0.281s
> > > user0m0.244s
> > > sys 0m0.016s
> >
>
> Can someone do a test for 5 minutes of parsing
Rather I mean can someone do a more realistic test such as parsing 1500 files
instead of one single file. At lea
> >
> > No more strlen:
> > http://www.hu.freepascal.org/fpcircbot/cgipastebin?msgid=1432
>
This doesn't work if you have spaces in front of the < tags >
I'm not sure if the Perl one fails too though.
I don't have perl installed and can't test it ;-)
A real parser doesn't care abo
On the main site, will there ever be a sponsor/donation button that is extremely
easy to click and use?
Because anyone with guts who uses FPC and anyone worth their salt would click it
and send something for sure. Weaklings of course would not. But we aren't all.
I realize contributing code is mo
> > > There has been a long discussion on the Shootout forums about it. Isaac
> > > believes that it is more fair this way for languages that don't have all
> > > benchmarks implemented. Now we simply have to make him retract all our
> > > poor performing programs :)
> >
> > Exactly. A not very fa
> The compiler uses shortstrings internally, which are the fastest string
> type. Pchars are between ansistrings and strings, but offer the least
> comfort of all.
Also WordString or LongIntString would be as fast or faster than a 255
Bytestring..
But haven't implemented or supplied a patch yet ;
> The C program in the shootout uses pcre (Perl-compatible
> regular expressions). It would be very nice if FPC came
> with pcre.
I am also looking to ship PCRE with Powtils too since TRegexp isn't the best in
all situations.
We wrapped Tregexp too:
http://z505.com/cgi-bin/powtils/docs/1.6/idx.c
I tried:
http://www.hotlinkfiles.com/files/526004_qpvr0/pcre-fpc.tar.gz
Can't get it to work.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> >> Ok, now somebody has to fix the regexpr unit and accelerate it *g*
> >
> > The C program in the shootout uses pcre (Perl-compatible
> > regular expressions). It would be very nice if FPC came
> > with pcre.
>
> Well, that way we can never win :) Anyways, I think having an libc
> independent
There is also:
http://www.renatomancuso.com/software/dpcre/dpcre.htm
(By the way, why all these people wrap PCRE in a class is beyond me. Object
oriented PCRE.. defeats the bloody purpose of regular expressions in the first
place - quick and dirty access to regexes must not be stored in a class.
> Doing a dumb header port is not that hard. If you can't do it, start making
> tests, and I'll do it.
L505 loves flamebaits. They are what I eat for breakfast.
I personally like to spend my time doing useful things, and if someone has
already made the translation then I'm not going to waste time
> Under windoze, I've found that programs take longer to run the
> first time they are executed after recompilation. Is Linux the
> same way?
This may have something to do with certain code/data being cached.. I'm not sure
what since a console program doesn't use many DLL's.. It must cache the ex
> Unfortunately, it's slightly slower than my fastest program that
> uses the library that comes with FPC. I wonder if the dll was
> compiled with all of the C compiler's optimiaztions turned on.
May have to make an .O file..
For example static linking.. instead of dynamic.
AFAIK one can link d
> > > Doing a dumb header port is not that hard. If you can't do it, start
> > > making
> > > tests, and I'll do it.
>
> (skip nonsense stuff)
No, not nonsense. Jeff P. (yetanothergeek) had a header for freepascal not using
any JCL, AFAIK. Which is the original link I provided, which wasn't workin
> > > Doing a dumb header port is not that hard. If you can't do it, start
> > > making
> > > tests, and I'll do it.
>
> (skip nonsense stuff)
No, not nonsense. Jeff P. (yetanothergeek) had a header for freepascal not using
any JCL, AFAIK. Which is the original link I provided, which wasn't workin
How to target linux, bsd, and cPanel with Delphi on Windows.. using magic..
http://z505.com/videos/d5/linux-delphi-webapp.htm
Mirror:
http://iknow.z505.com/vid/linux-delphi-webapp.htm
Maybe a friend/competitor to the CrossFPC project. But with more of a focus on
server, web development, and conso
Leonardo and I have been working on structuring together some notes and docs for
fcl-db and sqldb. I am not as experienced with sqldb yet but as I have more time
there will be more notes added.
http://z505.com/cgi-bin/powtils/docs/1.6/idx.cgi?file=fcldbnotes
An interface view is also available:
h
> Where do I get a Doc ID to edit those pages?
The current doc id is -lufdocz- including dashes.
We'd be happy if you helped.. there is also the tiOPF page that I opened..
> There are loads of
> spelling and grammar mistakes I would like to fix. Oh btw, 'Remember'
> is still spelled incorrectl
Using fpmake, how does one append a compiler option like
-dSOMEDEFINE
Or
-xxSomeOptionNotIntegratedYet
I will put this info in the FPMAKE wiki page if it is possible to do.
Regards,
L505
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
ht
I wrote:
Using fpmake, how does one append a compiler option like
-dSOMEDEFINE
Solution:
Target.options:= '-dSOMEDEFINE';
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Michael wrote:
3 ways:
Thanks.. added compiler option info to the fpmake wiki page.
Now I'm wondering..when I use "fpmake clean" it doesn't clean any units that were
compiled implicitly.. i.e. units that were not called in with AddUnit, but compiled because they
were in uses clause of units
> also FPC doesn't support the "path/unitname.pas"> construction, Delphi can't manage exported
> variables from dynamic linking modules (DLL, so, dylib...) but FPC
> does it, etc.
FPC supports:
uses
unit1 in "../foo/bar/somefile.pas";
I am using this so I don't have to ship FPC config files
> While using synapse in a thread, I saw that it didn't report an error
on connection,
> eventually I saw that the call to WSAGetLastError was returning 0
even if it couldn't
> connect and the connect call returned an error.
I am also working on this issue still.
I had the WSAGetLastError work
Luca wrote:
I don't think that synapse is to blame[*]: my test
program is also using the sockets unit directly, and stores SocketError
(which just calls WSAGetLastError) in a variable.
Found the problem using my brute force writeln('') skills. It is an
issue with freepascal's stack or somet
L wrote:
Luca wrote:
I don't think that synapse is to blame[*]: my test
program is also using the sockets unit directly, and stores SocketError
(which just calls WSAGetLastError) in a variable.
Found the problem using my brute force writeln('') skills. It is an
issue wi
L wrote:
Aha.. I changed the by Value parameter to a CONST parameter in the
error procedure (Perror).. And this solves the issue..
So something to do with calling by Value within a thread versus a
const (pointer?).
I will attach the problem in the bug report previously opened if I can
> This seriously worries me, since I use threads extensively, and I
mostly use call by value
> parameters.
Bye
--
Luca
I use CONST parameters wherever possible for strings.. so that:
1) if I ever port the code to a DLL it is safer (can cast pchar in)
2) const is a stricter contract
3) perfor
http://stanleyxu2005.blogspot.com/2008/01/potential-memory-leak-by-initializing.html
Interesting..
So with
procedure InitRecord(out R; SizeOfRecord: Integer);
begin
FillChar(R, SizeOfRecord, #0);
end;
Even if it has dynamic array, ansistrings, shortstrings, integers,
I assume it is okay to i
how to set it without writing a text driver plugin?
There was something like SetInOutRes for delphi in some unit.
Is global inoutres a threadvar, btw? Safe to set it directly as a global
variable (eek.. should there be some function?) The docs say that it is
"read only".
http://www.freepasca
I wrote:
and using fpFlock on windows.
Typo: on unix
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Florian wrote..
Records and objects containing automated fields are initialized? Or do I
miss something?
Oh...?
This is something I have never been clear about :-(
So a record with an ansistring and an integer.. for example even local scope..
Will be all zeros?
procedure test;
var somerec:
L wrote:
Florian wrote..
Records and objects containing automated fields are initialized? Or do I
miss something?
Oh...?
This is something I have never been clear about :-(
p.s. see also:
http://community.freepascal.org:1/bboards/message?message_id=223327&forum_id=24082
So. l
I think fpc compiler should compile .dpr files without having to type
the extension.. me is lazy..
fpc prog
this compiles prog.pp but doesn't do prog.dpr ;-)
What do we think?
I can supply patch and work on it if you think it is useful.
p.s. I haven't checked, does fpc automatically compile
I think confusion was created also because that guys blog post only had
a record with one field in it (a string).. he should have used more
fields with integers, pointers, etc to demonstrate a point more.
___
fpc-pascal maillist - fpc-pascal@lists.
One thing to ponder about:
A class inside a record...
trecord = record
something: TSomeClass;
int: integer;
//... etc
end;
My brain hurts.
This will cause issues with a Fillchar for the class, or not?
I wouldn't use this normally (a class inside a record), but it is still
interesting to th
Recently we discussed records and how to initialize them.. Jonas cleared
up a lot for me (and Marco/Florian etc.). Thanks much..
So.. now I ask..
type something = class
s: ansistring;
int:integer
end;
Is "int" set to zero when it is a local scope var in a procedure created
on the heap with C
What about old borland objects (heap and stack initialization) process?
I am guessing they are more like records... or do heap objects act like
classes in that they are filled with zeros?
p.s. I think the inconsistent behavior between local scope records and
global scope records is kind of a
I wrote:
What about old borland objects (heap and stack initialization) process?
program test1;
type
trec = record i: integer; end;
tclass = class i: integer; end;
tobj = object i: integer; end;
pobj = ^Tobj;
procedure show;
var rec: trec; c: tclass; o: tobj; po: pobj;
begin
write
>Using uninitialised variables is virtually always bad, regardless of the
> scope. And the fact that
> global variables are zeroed at the program start is afaik not defined
> by the Pascal standard. It's
> just a side effect of the way most operating systems work.
I think something like:
proce
I wrote:
I think something like:
procedure test;
var blah: integer = 0;
begin
end;
Is useful.. i.e. initialized variables that are done on the spot.
To expand on this.. not only local scope vars, but global..
var
global: integer = 0;
I agree is much clearer than leaving it to the assumpti
I wrote:
3. local class zeroed
4. global class zeroed
I meant class instance zeroed
(Regarding Jonas' nitpick ;-)
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Joao Morais replied to Jonas with:
>I think I didn't get your point. What about this piece of code:
>
>interface
>
>function foo: tfoo;
>
>implementation
>
>var
> _foo: tfoo;
>
>function foo: tfoo;
>begin
> if not assigned(_foo) then
> _foo := tfoo.create;
> result := _foo;
>end;
>
>Is it safe?
> Pascal does not define any variable initialization itself - one should
> always init all Pascal vars of any type. Doing so is an excellent
coding > habit also portable to any other language/OS - protects against
> low-level implementation changes.
>
> I never trust a side effect I didn't code
ion problems to bugs.freepascal.org and
svn.freepascal.org.
[EMAIL PROTECTED]:~/temp> svn co
http://svn.freepascal.org/FPC/svn/lazarus/trunk l
svn: requerimiento PROPFIND falló en '/FPC/svn/lazarus/trunk'
svn: PROPFIND de '/FPC/svn/lazarus/trunk': 405 Method Not Allowed
(http:/
Aservia Project Started. A new simple stable web server for FPC and
possibly delphi.
http://powtils.googlecode.com/svn/dev/tools/aservia/
100% Free license.
It supports CGI and html.
Based on nYume with more added and more cleaned up code. If nYume
author is listening, or any interested peop
Consider local procedure scope stack records in MODE OBJFPC:
procedure
var
R1: TSomeRecord = ();
R2: TSomeRecord;
procedure
var
O1: TSomeOldObject = ();
O2: TSomeOldObject;
In the case of R1 and O1, it seems the record's fields are initialized
to zero, even though the fields are not sp
A creative idea:
procedure Query(trick: Array of Const);
begin
for i:=
CASE
// interesting code here
end;
const SELECT = 1; // token
WHERE = 2; // token
FROM = 3; // token
INSERT = 4; // token
begin
Query([SELECT, 'foo', FROM, 'bar'])
Query([INSERT, INTO, 'bar', WHERE
I found an issue in Aservia where linux was opening threads and not
closing them.
Using OpenWebLoad or Apache Bench the server would simply hang up after
380 requests (threads) were opened.
Sometimes using a home web server, one has less than 380 threads ever
opened in his application over a
1 - 100 of 158 matches
Mail list logo