Re: [fpc-pascal] Zeosdbo

2015-04-13 Thread Michael Van Canneyt



On Mon, 13 Apr 2015, Terry A. Haimann wrote:


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.


What are the errors you are getting ? 
Lazarus packages (I'm assuming you use a zeos package) add lots of options to the 
command-line compiler, most notably -Fu and -Fi options, you should at least mimic 
those if you compile on the command-line.


It's also perfectly possible to create command-line programs in lazarus, and 
compile them on the command-line using lazbuild.
I use that technique myself for automated builds, and it works like a charm.

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


Re: [fpc-pascal] Zeosdbo

2015-04-13 Thread Graeme Geldenhuys
On 2015-04-13 17:51, Terry A. Haimann wrote:
 I'm sure its possible to connect to Mysql with Zeosdbo from a command
 line FreePascal Program, but I am not sure how.

Here is a build script I use to compile tiOPF's test suite. In part it
includes compiling Zeos for connecting to MySQL and Firebird.

==
#!/bin/sh
# Build script for tiOPF's Console Test Runner using 64-bit Free Pascal
Compiler

BASEDIR=/data/devel
TARGET=x86_64-freebsd
TIOPF=$BASEDIR/tiopf_dailybuilds/tiopf
FBLIB=$BASEDIR/tiopf_dailybuilds/fblib/src
ZEOS=$BASEDIR/opensource/zeos_svn
FPTEST=$BASEDIR/fptest
FPC=$BASEDIR/fpc-2.6.4/$TARGET/bin/ppcx64

$FPC -S2cgi -O1 -gl -ve -l \
  -FU$TIOPF/Compilers/FPC/lib/$TARGET/ \
  -Fu$FBLIB \
  -Fi$FBLIB \
  -Fu$ZEOS/src/core \
  -Fu$ZEOS/src/component \
  -Fu$ZEOS/src/dbc \
  -Fu$ZEOS/src/parsesql \
  -Fu$ZEOS/src/plain \
  -Fu$ZEOS/packages/lazarus/ \
  -Fi$TIOPF/Core/ \
  -Fu$TIOPF/Core/ \
  -Fu$TIOPF/Options/ \
  -Fi$TIOPF/Core/ \
  -Fu$TIOPF/UnitTests/Common/ \
  -Fu$TIOPF/UnitTests/Tests/ \
  -Fu$FPTEST/src/ \
  -Fu$FPTEST/3rdparty/epiktimer/ \
  -Fu. \
  -o$TIOPF/Compilers/FPC/tiOPFUnitTestsConsole \
  -dDUNIT2 -dXMLLISTENER \
  -dLINK_CSV -dLINK_TAB -dLINK_XMLLIGHT \
  -dLINK_SQLDB_IB -dLINK_FBL -dLINK_ZEOS_FB -dLINK_ZEOS_MYSQL50 \
  -dUseCThreads \
  $TIOPF/Compilers/FPC/tiOPFUnitTestsConsole.lpr
==


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
___
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] Endian Hex numbers

2015-04-13 Thread Torsten Bonde Christiansen

Hi list.

Please forgive me if this is too dumb a question, but:

When using a const written in hex, is the order significant?
Ie. will eg. $1F01 result in the same value (7937) on both big-endian 
and little endian machines?



Likewise, if I use an absolute reference to a variable is the endianness 
also significant?

ex.:

const
  A: SmallInt = $1F01;

var
  B: array[0..1] of byte absolute A;


Will B[0] be the same on both types of endian machines?

Regards,
Torsten.









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

Re: [fpc-pascal] Endian Hex numbers

2015-04-13 Thread Michael Van Canneyt



On Mon, 13 Apr 2015, Torsten Bonde Christiansen wrote:


Hi list.

Please forgive me if this is too dumb a question, but:

When using a const written in hex, is the order significant?
Ie. will eg. $1F01 result in the same value (7937) on both big-endian and 
little endian machines?


Yes. 
It will be stored differently in memory, but the representation of the value is the same, regardless of the storage.





Likewise, if I use an absolute reference to a variable is the endianness also 
significant?
ex.:

const
  A: SmallInt = $1F01;

var
  B: array[0..1] of byte absolute A;


Will B[0] be the same on both types of endian machines?


No, because here you actually access the memory, and the memory layout will 
differ.

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