Re: [fpc-pascal] Challenging port of Borland Pascal program to FPC

2010-01-18 Thread Mehmet Erol Sanliturk

John Youngquist wrote:

Interesting response.

I routinely implement large systems on the 8051 chip in assembly language
which I can write faster than Pascal. Assembly is a minimum of 500% 
faster than

C on the 8051. I hate C anyway.

The machine is a pick  place machine designed to assemble SMT
circuit boards. It was originally controlled by a Borland Basic 
program written in
Japan without any useful comments. With 5 or 6 statements per line 
without even
a single space it looked like Japanese to me. Initially I needed to 
fix a few bugs
and add a few features so I studied the code for while - all 100K 
statements of it.
I decided rewriting it from scratch would be faster that figuring it 
out. In exactly 2 weeks
I had replicated and enhanced the original functionality with 3K lines 
of Pascal. I still
had to study the code to figure out how drive their special hardware, 
but over the years
all of it has been replaced with simpler stuff. Numerous enhancements 
have

swelled the code to 8K lines using less than 2 64K blocks of memory.
The before/after size ratio shows how poorly the basic was done.
As implemented in BP it works very well. The multi-tasking part handles
functions that are not time critical, operating air cylinders that 
don't know what a mSec

is. The fast motion is handled independently by Animatics Smart motors.

I have never explored the multimedia timers. I drive the LPT int to 
get my own periodic
interrupt because the multi-task code already uses the timer. As you 
know there are 3

timers in the timer chip but only one will generate an interrupt.

One problem I have yet to solve is the BP IDE when it hits a 
breakpoint kills my LPT interrupt.
Nothing but an IDE restart will restore it. It sure cramps your 
debugging style.




You may think

http://www.freedos.org/

in a simple PC with Free Pascal

http://www.freedos.org/cgi-bin/lsm.cgi?mode=dirdir=devel


I think , you may directly use your Pascal program in DOS mode : Port 
I/O , Interrupts , etc.


Thank you very much .

Mehmet Erol Sanliturk











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


Re: [fpc-pascal] Generics problem/question

2010-01-18 Thread Aleksa Todorovic
On Fri, Jan 15, 2010 at 09:00, leledumbo leledumbo_c...@yahoo.co.id wrote:

 Ah... I can see it now:

 711  function TFPGList.IndexOf(const Item: T): Integer;
 712  begin
 713    Result := 0;
 714    {$info TODO: fix inlining to work! InternalItems[Result]^}
 715    while (Result  FCount) and (PT(FList)[Result]  Item) do
 716      Inc(Result);
 717    if Result = FCount then
 718      Result := -1;
 719  end;

 This is where the = operator is required ( is derived from = ).

 I continue the discussion in mantis, so that this can be solved (hopefully).

I've attached patch to mantis bug which makes compiler print error
about missing operator TPar = TPar. This could, at least, give
user some hint about what is wrong.

The proper solution for this problem is not simple. Somehow, you will
have to make operator = (const A, B: TPar) visible inside FGL unit
(because of the way generics are currently implemented), or make
compiler think that TPGList is implemented in the place where
specialization occurs (so compiler first searches specialization
space, and after that generic-declaration space).
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: creating a standalone executable (eg: applicationinstallation file)

2010-01-18 Thread Paul Nicholls

- Original Message - 
From: Graeme Geldenhuys 
graemeg.lists-re5jqeeqqe8avxtiumw...@public.gmane.org
Newsgroups: gmane.comp.compilers.free-pascal.general
To: FPC-Pascal users discussions 
fpc-pascal-pd4fty7x32k2wbthl531ywd2fqjk+...@public.gmane.org
Sent: Tuesday, January 12, 2010 11:37 PM
Subject: creating a standalone executable (eg: applicationinstallation file)


 Hi,

 I have seen a few Linux application that have standalone executables
 that are installation programs. Once run, it installs the application
 in the appropriate directory location, can run as root or normal user
 and creates a desktop and Application menu icon. Similar to Windows's
 setup.exe idea. An example of such a Linux application is
 'installpixel32' from the Pixel32 project, or Kylix 3 installation.

 * How does one create such a standalone application?
 * How do you include the application executable and other resources
 (text, image, sound files etc) inside such an installation executable?


 I'm trying to create (mainly for our company, but probably open-source
 in the end) such a standalone setup creation for our projects. This
 way it will be Linux distro independent. I also don't want to go the
 route of projects like AutoPackage that first requires a setup runtime
 to be installed. I want a installation file like what Pixel32 did. One
 installation executable without any installation runtime etc. and
 after the installation, I can simply click on 'uninstall' or run
 'setup -u' and a graphical uninstaller is launched.

 I'm going to look at Loki Games's setup program to see if I can port
 it to fpGUI Toolkit, or at least get some ideas of how to create such
 a setup application. Basically I'm trying to create a InstallShield
 Lite but for Linux. :-)  The nice thing of Loki Games is that it run
 run as a console installation or a GUI installation - again, no idea
 how they managed that, but it was possible (Kylix 3 installation did
 that).

 Anybody have pointers or internet links I can read up on the subject?

 -- 
 Regards,
  - Graeme -


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


Hi Graeme,
   perhaps this link might help - it shows you how to create a linux script 
with appended zip'd data, and then make it executable so it can be run as a 
normal program :)

http://www.franzone.com/2008/08/14/how-to-create-a-bash-install-script/

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

Re: [fpc-pascal] Re: creating a standalone executable (eg: applicationinstallation file)

2010-01-18 Thread Graeme Geldenhuys
Paul Nicholls wrote:
 
 http://www.franzone.com/2008/08/14/how-to-create-a-bash-install-script/

Thanks Paul. I guess the author of that website didn't know about Makeself,
which automates the exact same procedure he does manually.

Either way, that seems to be the popular way of distributing applications
in a distro independent manner.

The installer I'm working on will probably start as a script, unpack itself
and then figure out if it should run the Console setup or the GUI setup -
depending if X11 is available and running. This will also allow me to pick
the correct setup for the architecture (32bit or 64bit install, *BSD or
Linux binary etc).

So far my GUI setup is looking pretty neat and is completely configurable
at runtime using a setup.xml file. Later I'll create a install builder
which will generate that setup.xml file for the user/developer.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

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