[fpc-pascal] FreePascal and the OrangePi

2022-10-21 Thread Terry A. Haimann via fpc-pascal
Dumb ?

What download should I use to install the latest version of FreePascal
on the OrangePi 4 LTS, I am running Debian 3.0.6 Bullseye.

The Orange Pi 4 LTS is an SBC running an ARM Processor.
Rockchip 3399 SOC

http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/orange-pi-4-LTS.html

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


Re: [fpc-pascal] Test Free Pascal program not compiling

2022-09-13 Thread Terry A. Haimann via fpc-pascal
L
[0.398] Adding helper for SYSTEM_$$_LONGBOOL
[0.398] (SQRT) Load from SQRT (implementation) unit MATH
[0.398] (MATH) Loading unit MATH
[0.398] Unitsearch: Math.ppu
[0.398] Searching file Math.ppu... not found
[0.398] Searching file math.ppu... not found
[0.398] Searching file MATH.PPU... not found
[0.398] Unitsearch: Math.pp
[0.398] Searching file Math.pp... not found
[0.398] Searching file math.pp... not found
[0.398] Searching file MATH.PP... not found
[0.398] Unitsearch: Math.pas
[0.398] Searching file Math.pas... not found
[0.398] Searching file math.pas... not found
[0.398] Searching file MATH.PAS... not found
[0.398] Unitsearch: /usr/lib/fpc/3.0.2/units/arm-linux/rtl/Math.ppu
[0.398] Searching file /usr/lib/fpc/3.0.2/units/arm-
linux/rtl/Math.ppu... not found
[0.398] Searching file /usr/lib/fpc/3.0.2/units/arm-
linux/rtl/math.ppu... found
[0.398] PPU Loading /usr/lib/fpc/3.0.2/units/arm-linux/rtl/math.ppu
[0.398] (MATH) PPU Name: /usr/lib/fpc/3.0.2/units/arm-
linux/rtl/math.ppu
[0.398] (MATH) PPU Time: 2017/02/18 16:59:12
[0.398] (MATH) PPU Flags: 178304
[0.398] (MATH) PPU Crc: 4669D5C9
[0.398] (MATH) PPU Crc: 655D56A5 (intfc)
[0.398] (MATH) PPU Crc: BEE36B37 (indc)
[0.398] (MATH) Number of definitions: 520
[0.398] (MATH) Number of symbols: 1430
[0.398] (MATH) PPU Source: math.pp not available
[0.398] (MATH) PPU Source: mathu.inc not available
[0.398] (MATH) Load from MATH (interface) unit SYSTEM
[0.406] (MATH) Adding dependency: MATH depends on SYSTEM
[0.406] (MATH) Load from MATH (interface) unit OBJPAS
[0.406] (MATH) Adding dependency: MATH depends on OBJPAS
[0.406] (MATH) Load from MATH (interface) unit SYSUTILS
[0.406] (MATH) Adding dependency: MATH depends on SYSUTILS
[0.414] (MATH) Finished loading unit MATH
[0.414] Searching file Sqrt.pas... found
[0.414] Sqrt.pas(3,1) (SQRT) Parsing implementation of Sqrt.pas
[0.414] Sqrt.pas(2,16) Hint: Unit "math" not used in Sqrt
[0.414] (SQRT) Unloading resource unit FPINTRES (not needed)
[0.422] Assembling sqrt
[0.422] Searching file /usr/lib/fpc/3.0.2/as... not found
[0.422] Searching file /usr/lib/fpc/3.0.2/AS... not found
[0.422] Searching file /usr/local/bin/as... not found
[0.422] Searching file /usr/local/bin/AS... not found
[0.430] Searching file /usr/bin/as... found
[0.430] Using assembler: /usr/bin/as
[0.430] Executing "/usr/bin/as" with command line "-mfpu=softvfp -o
Sqrt.o  Sqrt.s"
Assembler messages:
Error: unrecognized option -mfpu=softvfp
[0.508] Sqrt.pas(10,27) Error: Error while assembling exitcode 1
[0.508] Sqrt.pas(10,27) Fatal: There were 2 errors compiling module,
stopping
[0.570] Fatal: Compilation aborted
Error: /usr/bin/ppcarm returned an error exitcode
terry@libre-computer:~/Documents/fpc/Silly$ 

On Mon, 2022-09-12 at 07:22 +0200, Christo Crause wrote:
> 
> On Mon, 12 Sep 2022, 02:59 Terry A. Haimann via fpc-pascal, <
> fpc-pascal@lists.freepascal.org> wrote:
> > Trying to compile a small test pascal program on a arm cpu.  I
> > beleive
> > 
> > it is an a53.  Libre Le Potato
> > 
> > 
> > 
> > I am getting the following error:
> > 
> > 
> > 
> > Error: Error while assembling exitcode 1
> > 
> > 
> > 
> > Thanks in advance,
> > 
> > 
> > 
> > Terry H.
> 
> Enable the compiler's verbose mode (-va). The real error is sometimes
> printed much earlier in the compiler output.
> 
> 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Test Free Pascal program not compiling

2022-09-11 Thread Terry A. Haimann via fpc-pascal
Trying to compile a small test pascal program on a arm cpu.  I beleive
it is an a53.  Libre Le Potato

I am getting the following error:

Error: Error while assembling exitcode 1

Thanks in advance,

Terry H.


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


Re: [fpc-pascal] FreePascal and MySQL 8.0

2021-09-20 Thread Terry A. Haimann via fpc-pascal
https://github.com/fpc/FPCSource/tree/main/packages/mysql

I do not understand. I see a source file for mysql80dyn.pp, but
shouldn't tthere also be a mysql80conn.pp?

Terry H.

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


Re: [fpc-pascal] FreePascal and MySQL 8.0

2021-09-19 Thread Terry A. Haimann via fpc-pascal
I hate to sound stupid, but ...

I found the link to fpc.zip, but firefox
can't do anything with it.  If it is a ftp site I need to go to, I need
the address and user/pw/port to get in.

I found a refrence to
fpc.dfmk.hu, but I don't know user/pw/port.

Thank You for your
attention.

Terry H.

On Sat, 18 Sep 2021, Terry A. Haimann via fpc-pascal wrote:

> I just upgraded to a new laptop and see that MariaDB is using MySQL
8.0
> . I also see there is no connector in my Free Pascal install for
MySQL
> 8.0.  I do see that there is an open ticket to create a
connector.  Is
> there an Alpha or Beta version of the connector available that I can
> try?

Trunk contains the mysql 8.0 connector.
You should be able to simply copy the files and use the units with
3.2.x

Michael.

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


[fpc-pascal] FreePascal and MySQL 8.0

2021-09-18 Thread Terry A. Haimann via fpc-pascal
I just upgraded to a new laptop and see that MariaDB is using MySQL 8.0
. I also see there is no connector in my Free Pascal install for MySQL
8.0.  I do see that there is an open ticket to create a connector.  Is
there an Alpha or Beta version of the connector available that I can
try?

Thank you for your attention,

Terry

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


[fpc-pascal] FreePascal inc file

2021-08-23 Thread Terry A. Haimann via fpc-pascal
Hello,

I tried to compile something that used "osunits.inc" on a
Raspberry Pi.  I couldn't find the file.  Yes I installed fpc-source.

Thanks for your attention,

Terry H.

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


[fpc-pascal] Benchmarks

2018-07-08 Thread Terry A. Haimann
I am curious,

Has anyone benchmarked the new AMD Ryzen vs Intel chips with
FreePascal.  10 years or so ago, I had a multi core AMD Desktop and an
Intel based laptop.  With FreePascal the laptop was outperforming the
desktop.  When I upgraded that machine, I upgraded to Intel since I use
FreePascal a lot.  I was wondering if the situation was still the same?

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

[fpc-pascal] Lazarus and Linked Lists

2018-06-26 Thread Terry A. Haimann
Dumb question,

Is there a basic linked List object for Lazarus?

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

[fpc-pascal] I am trying to install zeosdbo

2018-06-15 Thread Terry A. Haimann
I am trying to install zeosdbo onto my Lazarus install and am getting
the following error during the rebuild:
Build IDE: Exit code 512, Errors: 1lazarus.pp(1,1) Fatal: Cannot find
aarrebase used by Lazarus. Check if package aarrebase creates
aarrebase.ppu, check nothing deletes this file and check that no two
packages have access to the unit source..
Lazarus version:  Lazarus 1.8.2+dfsg-3 rDebian package 1.8.2+dfsg-3 FPC
3.0.4 x86_64-linux-gtk2
This was installed from apt-get for Ubuntu 18.04This was using:
ZEOSDBO-7.1.3a-stable.zip___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Connecting to a database from a commandline pascal program

2018-02-16 Thread Terry A. Haimann
Hello,

I am trying to write a command Line Pascal program to connect to a MySQL
database using the ZeosDBO Library. I am sure I have done something
stupid. 

I have it now so that it will compile, but it crashes as soon as I try
to modify my TZConnection variable.


I have it defined as:

MyConnection:   TZconnection;

And code is defined as:

WriteLn('2');
MyConnection.Create(Nil);
// MyQuery.Create(Nil);
WriteLn('2.0);
MyConnection := '127.0.0.1';
WriteLn('2.1');
MyConnection.Protocol   := 'mysql';
WriteLn('2.2');
MyConnection.Database   := 'MyDatabase';
WriteLn('2.3');
MyConnection.User   := 'MyUser';
WriteLn('2.4');
MyConnection.Password   := 'MyPass';
WriteLn('2.5');
MyConnection.Connected := True;
WriteLn('2.6');

It never hits 2.0, so I believe it is dying on the create. Am I doing
the create wrong?  I can't find any examples as too doing this, I have
tried googling it.  Most of the examples I see are doing this from
Lazarus.  Not from a command line Free Pascal program. 

Thanks in advance,  Terry H. 

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

Re: [fpc-pascal] Trying to compile ZeosDBO cli program

2018-02-13 Thread Terry A. Haimann
Never mind I have it figured out.  You have to add the path to
the /etc/fpc.cfg file, such as:

-Fu/home/user/ZeosDBO/packages/lazarus/lib/x86_64-linux

I remembered we do something like this years ago with an older mysql
library.

Terry H.



I tried adding the following to my path:

/home/terry/ZeosDBO/src/plain
/home/terry/ZeosDBO/src/
/home/terry/ZeosDBO/src/component
/home/terry/ZeosDBO/src/core
/home/terry/ZeosDBO/src/dbc
/home/terry/ZeosDBO/src/parsesql

And when I try to coompile, it is still saying:
Can't find Unit Zconnection 

I only added the paths in temporarily.


On 13/02/2018 15:48 μμ, Terry A. Haimann wrote:
> I really do not understand your response.  If you are talking about
> Lazarus, I already have it working there.
OK

> I am wanting to get it to
> work from a command line batch program using fpc.  Using fpc I do not
> know how to set required packages and from fpc I do not know where a
> Project Inspector would be.

Oh! I assumed that the cli application was edited from lazarus in that 
case add the folder where the code is to your path not the compiled 
binaries. I Assume something along the lines of
/home/terry/ZeosDBO/src/plain
/home/terry/ZeosDBO/src/
/home/terry/ZeosDBO/src/component
/home/terry/ZeosDBO/src/core
/home/terry/ZeosDBO/src/dbc
/home/terry/ZeosDBO/src/parsesql


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

Re: [fpc-pascal] Trying to compile ZeosDBO cli program

2018-02-13 Thread Terry A. Haimann
I tried adding the following to my path:

/home/terry/ZeosDBO/src/plain
/home/terry/ZeosDBO/src/
/home/terry/ZeosDBO/src/component
/home/terry/ZeosDBO/src/core
/home/terry/ZeosDBO/src/dbc
/home/terry/ZeosDBO/src/parsesql

And when I try to coompile, it is still saying:
Can't find Unit Zconnection 

I only added the paths in temporarily.


On 13/02/2018 15:48 μμ, Terry A. Haimann wrote:
> I really do not understand your response.  If you are talking about
> Lazarus, I already have it working there.
OK

> I am wanting to get it to
> work from a command line batch program using fpc.  Using fpc I do not
> know how to set required packages and from fpc I do not know where a
> Project Inspector would be.

Oh! I assumed that the cli application was edited from lazarus in that 
case add the folder where the code is to your path not the compiled 
binaries. I Assume something along the lines of
/home/terry/ZeosDBO/src/plain
/home/terry/ZeosDBO/src/
/home/terry/ZeosDBO/src/component
/home/terry/ZeosDBO/src/core
/home/terry/ZeosDBO/src/dbc
/home/terry/ZeosDBO/src/parsesql


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

Re: [fpc-pascal] Trying to compile ZeosDBO cli program

2018-02-13 Thread Terry A. Haimann
I really do not understand your response.  If you are talking about
Lazarus, I already have it working there.  I am wanting to get it to
work from a command line batch program using fpc.  Using fpc I do not
know how to set required packages and from fpc I do not know where a
Project Inspector would be.

Mostly, at this point,I want to compare ZeosDBO's performance against
SqlDB.  I know how to do this with SqlDB, but think it's performance is
lackluster. 

Terry H


On 13/02/2018 04:50 πμ, Terry A. Haimann wrote:
> First of all, thank you for looking at this, Terry H.
>
> To compile a cli FreePascal program to use ZeosDBO library, I assume
all
> I have to do is include the path to those files.
>
> On my laptop, the files appear to be in:
>
> /home/terry/ZeosDBO/packages/lazarus/lib/x86_64-linux
>
> Well after adding that to the path and put ZConnection in the uses
> clause, it comes up with a "Can't find unit ZConnection"
>
you do not add the path (remove it) you add the ZeosDBO package to your 
required packages. Open the project inspector and select add new 
requirement. that will sort the file not found out for you.


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

[fpc-pascal] Trying to compile ZeosDBO cli program

2018-02-12 Thread Terry A. Haimann
First of all, thank you for looking at this, Terry H.

To compile a cli FreePascal program to use ZeosDBO library, I assume all
I have to do is include the path to those files.

On my laptop, the files appear to be in:

/home/terry/ZeosDBO/packages/lazarus/lib/x86_64-linux

Well after adding that to the path and put ZConnection in the uses
clause, it comes up with a "Can't find unit ZConnection"

At least a directory of that gives me these files:

ZAbstractConnection.oZDbcASA.o
ZDbcInterbase6ResultSet.ppu  ZDbcPooled.o ZEncoding.ppu
ZMatchPattern.ppu ZPlainLoader.o
ZSqlMetadata.o
ZAbstractConnection.ppu  ZDbcASA.ppu
ZDbcInterbase6Statement.oZDbcPooled.ppu   ZExpression.o
ZMessages.o   ZPlainLoader.ppu
ZSqlMetadata.ppu
ZAbstractDataset.o   ZDbcASAResultSet.o
ZDbcInterbase6Statement.ppu  ZDbcPostgreSqlMetadata.o
ZExpression.ppu  ZMessages.ppu
ZPlainMySqlConstants.o  ZSqlMonitor.o
ZAbstractDataset.ppu ZDbcASAResultSet.ppu
ZDbcInterbase6Utils.oZDbcPostgreSqlMetadata.ppu   ZExprParser.o
ZMessages.rsj ZPlainMySqlConstants.ppu
ZSqlMonitor.ppu
ZAbstractRODataset.o ZDbcASAStatement.o
ZDbcInterbase6Utils.ppu  ZDbcPostgreSql.o
ZExprParser.ppu  ZMySqlAnalyser.o
ZPlainMySqlDriver.o ZSqlProcessor.o
ZAbstractRODataset.ppu   ZDbcASAStatement.ppuZDbcIntfs.o
ZDbcPostgreSql.ppu   ZExprToken.o ZMySqlAnalyser.ppu
ZPlainMySqlDriver.ppu   ZSqlProcessor.ppu
ZAbstractTable.o ZDbcASAUtils.o  ZDbcIntfs.ppu
ZDbcPostgreSqlResultSet.oZExprToken.ppu   ZMySqlToken.o
zplain.oZSqlStrings.o
ZAbstractTable.ppu   ZDbcASAUtils.ppuZDbcLogging.o
ZDbcPostgreSqlResultSet.ppu  ZFunctionsConvert.o  ZMySqlToken.ppu
ZPlainOracleConstants.o ZSqlStrings.ppu
ZClasses.o   ZDbcCachedResultSet.o   ZDbcLogging.ppu
ZDbcPostgreSqlStatement.oZFunctionsConvert.ppuZOracleAnalyser.o
ZPlainOracleConstants.ppu   ZSqlUpdate.o
ZClasses.ppu ZDbcCachedResultSet.ppu ZDbcMetadata.o
ZDbcPostgreSqlStatement.ppu  ZFunctionsDateTime.o
ZOracleAnalyser.ppu   ZPlainOracleDriver.o
ZSqlUpdate.ppu
ZCollections.o   ZDbcCache.o ZDbcMetadata.ppu
ZDbcPostgreSqlUtils.oZFunctionsDateTime.ppu   ZOracleToken.o
ZPlainOracleDriver.ppu  ZStoredProcedure.o
ZCollections.ppu ZDbcCache.ppu   ZDbcMySqlMetadata.o
ZDbcPostgreSqlUtils.ppu  ZFunctionsMath.o ZOracleToken.ppu
ZPlainPostgreSqlDriver.oZStoredProcedure.ppu
ZCompatibility.o zdbc.compiled
ZDbcMySqlMetadata.ppuzdbc.ppu
ZFunctionsMath.ppu   zparsesql.compiled
ZPlainPostgreSqlDriver.ppu  ZStreamBlob.o
ZCompatibility.ppu   ZDbcConnection.oZDbcMySql.o
ZDbcResultSetMetadata.o  ZFunctions.o zparsesql.o
zplain.ppu  ZStreamBlob.ppu
zcomponent.compiled  ZDbcConnection.ppu  ZDbcMySql.ppu
ZDbcResultSetMetadata.ppuZFunctionsOther.ozparsesql.ppu
ZPlainSqLiteDriver.oZSybaseAnalyser.o
zcomponent.o ZDbcDbLibMetadata.o
ZDbcMySqlResultSet.o ZDbcResultSet.o
ZFunctionsOther.ppu  ZPgEventAlerter.o
ZPlainSqLiteDriver.ppu  ZSybaseAnalyser.ppu
zcomponent.ppu   ZDbcDbLibMetadata.ppu
ZDbcMySqlResultSet.ppu   ZDbcResultSet.ppuZFunctions.ppu
ZPgEventAlerter.ppu   ZPostgreSqlAnalyser.o
ZSybaseToken.o
ZComponentReg.o  ZDbcDbLib.o
ZDbcMySqlStatement.o ZDbcSqLiteMetadata.o
ZFunctionsStrings.o  ZPlainASAConstants.o
ZPostgreSqlAnalyser.ppu ZSybaseToken.ppu
ZComponentReg.ppuZDbcDbLib.ppu
ZDbcMySqlStatement.ppu   ZDbcSqLiteMetadata.ppu
ZFunctionsStrings.ppuZPlainASAConstants.ppu
ZPostgreSqlToken.o  ZSysUtils.o
ZConnectionGroup.o   ZDbcDbLibResultSet.oZDbcMySqlUtils.o
ZDbcSqLite.o ZGenericSqlAnalyser.oZPlainASADriver.o
ZPostgreSqlToken.ppuZSysUtils.ppu
ZConnectionGroup.ppu ZDbcDbLibResultSet.ppu  ZDbcMySqlUtils.ppu
ZDbcSqLite.ppu   ZGenericSqlAnalyser.ppu
ZPlainASADriver.ppu   ZPropertyEditor.o
ZTokenizer.o
ZConnection.oZDbcDbLibStatement.ozdbc.o
ZDbcSqLiteResultSet.oZGenericSqlToken.o   zplain.compiled
ZPropertyEditor.ppu ZTokenizer.ppu
ZConnection.ppu  ZDbcDbLibStatement.ppu
ZDbcOracleMetadata.o ZDbcSqLiteResultSet.ppu
ZGenericSqlToken.ppu ZPlainDbLibConstants.o
ZScriptParser.o ZUpdateSqlEditor.o
zcore.compiled   ZDbcDbLibUtils.o
ZDbcOracleMetadata.ppu   ZDbcSqLiteStatement.o
ZGroupedConnection.o ZPlainDbLibConstants.ppu
ZScriptParser.ppu   ZUpdateSqlEditor.ppu
zcore.o  ZDbcDbLibUtils.ppu  ZDbcOracle.o
ZDbcSqLiteStatement.ppu  ZGroupedConnection.ppu
ZPlainDbLibDriver.o

[fpc-pascal] FreePascal and MySQL ?

2017-11-20 Thread Terry A. Haimann
Hello,

This is probably a dumb question.  But I have data in a tstringlist that
I want to upload into a MediumText MySQL column.  It looks to me as if
you do something like:

Stream := TMemoryStream.Create;
MySL.SaveToStream(Stream);
Blobfield(BcfQuery.FieldByName('JobMemo')).
LoadFromStream(Stream);

But what I don't understand is how I indicate what row to add the
MediumText field to.  Is there some way to combine this with an insert
or update statement.  I have done a lot in the past with MySQL and
FreePascal, but I have mostly or entirely worked with standard columnar
data, i.e. (Strings, floats and integers).

Thanks in advance,

Terry H.

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

[fpc-pascal] Connecting to a MySQL Server

2017-10-05 Thread Terry A. Haimann
What library do I need to install on Raspian (Raspberry Pi) to allow
Free Pascal to attach to a Mysql Server.  Note the MySQL Server is
running on a i5 and is actully  MariaDB 5.5.47

An unhandled exception occurred at $000E7398:
EInOutError: Can not load default MySQL library ("libmysqlclient.so.18"
or "libmysqlclient.so"). Check your installation.
  $000E7398
  $0009BC0C
  $0008CDE8

Thanks in advance,

Terry

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

[fpc-pascal] MySQL 5.7 and FreePascal

2016-11-19 Thread Terry A. Haimann
Is it possible to connect to MySQL 5.7 using TSQLConnection or will  I
have to downgrade my MySQL Version?  I have FreePascal 3.0.0 which
appears to be the most current version.  I have it on a Ubuntu  Linux
16.10 X86-64 system.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] FreePascal and MySQL

2015-05-01 Thread Terry A. Haimann
I was kind of unimpressed with the performance of TSqlQuery compared to
c.  

I wrote two programs that built the same identical table.  A random set
of names with addresses.  I found the user time of the program written
in c was 20% of that which was written in Free Pascal.

Is there any chance of someone working on this library to improve
performance?

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


[fpc-pascal] Zeosdbo

2015-04-13 Thread Terry A. Haimann
I'm sure its possible to connect to Mysql with Zeosdbo from a command
line FreePascal Program, but I am not sure how.  I tried using the same
includes that are for the Lazarus components, but it didn't find those
files.  

Any help would be appreciated.

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


[fpc-pascal] Writing a Console App in FreePascal that connects to MySQL

2015-03-26 Thread Terry A. Haimann
I  was trying to see how to write a Console Appication in FreePascal
that will connect to MySQL.  I know how to do this in c, but thought it
would be interesting to be able to do it in Pascal.

How should FConnection and FTransaction be declared or are the declared
in a library somewhere?

I have the following source code which is based on the web site
http://wiki.freepascal.org/SqlDBHowto, but does not compile:

Program TestMysql;
Uses sqldb, mysql55conn;

Var
MyConnection:   TSQLConnector;
MyTransaction:  TSQLTransaction;
MyQuery:TSQLQuery;

function GetQuery : TSQLQuery;
  var MyQuery : TSQLQuery;
begin
  MyQuery := TSQLQuery.Create;
  MyQuery.Database := FConnection;
  MyQuery.Transaction := FTransaction;
  GetQuery := MyQuery;
end;

procedure CreateTransaction;
begin
  MyTransaction := TSQLTransaction.Create;
  MyTransaction.Database := MyConnection;
end;

Procedure CreateConnection;
Begin
MyConnection := TSQLConnector.Create(nil);
MyConnection.ConnectorType  := 'MySQL 5.5';
MyConnection.Hostname   := '127.0.0.1';
MyConnection.DatabaseName   := 'MyDB';
MyConnection.UserName   := 'MyUser';
MyConnection.Password   := 'MyPassword';
End;

Begin
CreateConnection;
CreateTransaction;
MyQuery := GetQuery;
MyQuery.SQL.Text := 'select ObjIdx, ObjCon from object' +
'Order By ObjCon, ObjIdx';
MyConnection.Open;
MyQuery.Open;
If MyConnection.Connected Then
Begin
While Not MyQuery.eof Do 
Begin
WriteLn(MyQuery.FieldByName('ObjIdx').AsString, 
MyQuery.FieldByName('ObjCon').AsString);
MyQuery.Next;
End;
End Else WriteLn('Failure');
MyQuery.Close
MyConnection.Close;
MyQuery.Free
MyConnection.Free;
MyTransaction.Free;
End.

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


[fpc-pascal] 64 bit ?

2011-05-18 Thread Terry A. Haimann
I have a desktop with a 64bit AMD x4 Phenom processor.  I have noticed 
that FreePascal programs perform worse on this computer then they do on 
my 32 bit laptop.  Integer performance seems to be about 3 times worse 
then on the laptop.  Now if I convert the pascal source to c and compile 
that as follows:


gcc -O3 -funroll-all-loops -o MyExecutable MySource.c

The performance is many times better then with FreePascal.  I assume 
that gcc is compiling to 64 bit here and generating an optimizing for 
the AMD processor.  Is there a way to do something similar with Free Pascal?


Thanks,Terry

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


Re: [fpc-pascal] Re: tstringlist.savetostream

2010-03-17 Thread Terry A. Haimann

OK,

I had a bunch of WriteLn in my program, so that is how I knew it was running to 
completion.  But I have removed them for this test. I changed my source from sending a chr(4) to 
pipe.closeinput, which seemed to give a little cleaner run in Lazarus.  My test linux command is 
just a ls -l to keep it simple.I am still not getting any jobs created in the AT 
Facility from my test fpc program. But I have some output from strace, but am not sure how to 
interpret it:

execve(./teest, [./teest], [/* 42 vars */]) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0
rt_sigaction(SIGFPE, {0x41f520, [], SA_RESTORER|SA_SIGINFO, 0x400d78}, NULL, 8) 
= 0
rt_sigaction(SIGSEGV, {0x41f520, [], SA_RESTORER|SA_SIGINFO, 0x400d78}, NULL, 
8) = 0
rt_sigaction(SIGBUS, {0x41f520, [], SA_RESTORER|SA_SIGINFO, 0x400d78}, NULL, 8) 
= 0
rt_sigaction(SIGILL, {0x41f520, [], SA_RESTORER|SA_SIGINFO, 0x400d78}, NULL, 8) 
= 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
readlink(/proc/self/exe, /home/terry/Documents/fpc/CommandProg/teest, 255) 
= 43
open(/etc/timezone, O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or 
directory)
stat(/etc/localtime, {st_mode=S_IFREG|0644, st_size=3543, ...}) = 0
open(/etc/localtime, O_RDONLY|O_LARGEFILE) = 3
read(3, TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\0\5\0\0\0\0..., 2048) 
= 2048
mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f513a9c4000
mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f513a9bc000
mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f513a9b4000
mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f513a9ac000
close(3)= 0
time([1268875052])  = 1268875052
mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f513a9a4000
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
readlink(/proc/self/fd/1, /dev/pts/4..., 255) = 10
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
readlink(/proc/self/fd/0, /dev/pts/4..., 255) = 10
ioctl(1, TIOCGWINSZ, {ws_row=63, ws_col=209, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_START or TCSETS, {B38400 -opost -isig -icanon -echo ...}) = 0
write(0, \33[6n, 4)   = 4
select(2, [1], NULL, NULL, {1, 0})  = 1 (in [1], left {0, 997000})
read(1, \33[63;1R, 256)   = 7
write(1, \33[m, 3)= 3
pipe([3, 4])= 0
pipe([5, 6])= 0
pipe([7, 8])= 0
access(at, F_OK)  = 0
fork()  = 7010
close(4)= 0
close(5)= 0
close(8)= 0
write(6, ls -l\n, 6)  = 6
read(3, , 1024)   = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
read(7, , 1024)   = 0
close(6)= 0
ioctl(1, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
munmap(0x7f513a9b4000, 32768)   = 0
exit_group(0)   = ?



Message: 5
Date: Wed, 17 Mar 2010 06:52:50 +0100 (CET)
From: mar...@stack.nl (Marco van de Voort)
Subject: Re: [fpc-pascal] Re: tstringlist.savetostream
To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Message-ID: 20100317055250.144d617...@turtle.stack.nl
Content-Type: text/plain; charset=US-ASCII

In our previous episode, Terry A. Haimann said:

 Virtually the same logic in a fpc program doesn't work.  The program 
 runs, but nothing is submitted to the AT facility.  I am suspecting 
 something is requiring one of the libraries in Lazarus that I can't seem 
 to get to compile in fpc such as fileutil, LResources or maybe 
 Controls.  But I may be missing something else.  Something could be 
 going on with the pipes that I don't understand.  I don't know of a way 
 to monitor the pipes or the AT Facility to see what is going on.  I am 
 running FC10-64
  


As said before, the FPC program might simply terminate and take the AT job
with it. Let it pauze at the end, e.g. a readln, and see if that makes a
difference.

A tool to see what is going could be strace


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http

[fpc-pascal] Re: tstringlist.savetostream

2010-03-16 Thread Terry A. Haimann

Ok, I have a Lazarus test program that has the following code:

procedure TMainForm.ExecButClick(Sender: TObject);
Var
  StdStrLst, ErrorStrLst:   TStringList;
  MyProcess: TProcess;
begin
 StdStrLst   := TStringlist.Create;
 ErrorStrLst := TStringlist.Create;
 MyProcess := TProcess.Create(nil);
 MyProcess.CommandLine := 'at -m ' + TimeEdit.Text;
 MyProcess.Options := MyProcess.Options + [poUsePipes];
 MyProcess.Execute;
 StdStrLst.Clear;
 StdStrLst.Add(CmdEdit.Text);
 StdStrLst.SaveToStream(MyProcess.Input);
 StdStrLst.Clear;
 StdStrLst.Add(chr(4));
 StdStrLst.SaveToStream(MyProcess.Input);
 StdStrLst.Destroy;
 ErrorStrLst.Destroy;
 MyProcess.Destroy;
end;

This program seems to submit commands to the At Facility without any 
issues.  They will even run invalid commands and return error messages 
in the mail command.


Virtually the same logic in a fpc program doesn't work.  The program 
runs, but nothing is submitted to the AT facility.  I am suspecting 
something is requiring one of the libraries in Lazarus that I can't seem 
to get to compile in fpc such as fileutil, LResources or maybe 
Controls.  But I may be missing something else.  Something could be 
going on with the pipes that I don't understand.  I don't know of a way 
to monitor the pipes or the AT Facility to see what is going on.  I am 
running FC10-64


program TestPrg;

Uses Classes, Process, SysUtils;
//  Uses Classes, SysUtils, fileutil, LResources, Forms, Controls, 
Graphics, Dialogs,

//  StdCtrls, Process;

Var
   i:Integer;
   Cmd, Pre, Post, StrVar, SwStr:String;
   MyProcess: TProcess;
   SOut, EOut, StdStrLst: TStringList;

Begin
   StdStrLst   := TStringlist.Create;
   SOut   := TStringlist.Create;
   EOut   := TStringlist.Create;
   MyProcess := TProcess.Create(nil);
   MyProcess.CommandLine := 'at -m now';
   MyProcess.Options := MyProcess.Options + [poUsePipes];
   MyProcess.Execute;
   StdStrLst.Clear;
   StdStrLst.Add('awk -F: ''{print $1\t$3\t$4}'' /etc/passwd | 
sort  /home/terry/Documents/fpc/CommandProg/Output.txt');

   StdStrLst.SaveToStream(MyProcess.Input);
   StdStrLst.Clear;
   StdStrLst.Add(chr(4));
   StdStrLst.SaveToStream(MyProcess.Input);
   SOut.LoadFromStream(MyProcess.Output);
   For i:=1 to SOut.Count Do
 WriteLn(SOut.Strings[i]);
   EOut.LoadFromStream(MyProcess.StdErr);
   For i:=1 to EOut.Count Do
 WriteLn(EOut.Strings[i]);
End.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] tstringlist.savetostream

2010-03-15 Thread Terry A. Haimann
After running tstringlist.savetostream how can I make sure that the 
buffer has been flushed and data sent successfully?


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


[fpc-pascal] including libraies ?

2010-03-14 Thread Terry A. Haimann

I tried to write a little utility to submit a command to the At Facility.

The code to do this is as follows:

program TestPrg;

Uses Classes, Process;

Var
   i:Integer;
   Cmd, Pre, Post, StrVar, SwStr:String;
   MyProcess: TProcess;
   SOut, EOut, StdStrLst: TStringList;

Begin
   StdStrLst   := TStringlist.Create;
   SOut   := TStringlist.Create;
   EOut   := TStringlist.Create;  
 EOut := TStringlist.Create; 
 MyProcess := TProcess.Create(nil);  
 MyProcess.CommandLine := 'at now';   
 MyProcess.Options := MyProcess.Options + [poUsePipes];  
 MyProcess.Execute;  
 StdStrLst.Clear;
 StdStrLst.Add('awk -F: ''{print $1\t$3\t$4}'' /etc/passwd | 
sort');
 StdStrLst.SaveToStream(MyProcess.Input);
 StdStrLst.Clear;  
 StdStrLst.Add(chr(4));

 StdStrLst.SaveToStream(MyProcess.Input);
 SOut.LoadFromStream(MyProcess.Output);
 For i:=1 to SOut.Count Do
 WriteLn(SOut.Strings[i]);
 EOut.LoadFromStream(MyProcess.StdErr);
 For i:=1 to EOut.Count Do
 WriteLn(EOut.Strings[i]);
End.


Running this code from a Lazarus test program works with out any 
problems.  When running it from a Free Pascal (non gui,) the program 
finishes normally, but nothing gets submitted to the AT Facility. 

uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, 
Dialogs,

StdCtrls, Process;

Someone on the Lazarus List recommend I add SysUtils to my utility 
program.  I am not sure how to do this.  SysUtils has many included 
files in there and they are all in other directories, none of which are 
in my path.  I am sure there is some simple method here that I am 
totally ignorant of.


Thanks in advance,   TH
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal