Re: [fpc-pascal] differences between .pp and .pas files

2013-02-25 Thread John Coppens
On Mon, 25 Feb 2013 12:36:18 +
Graeme Geldenhuys gra...@geldenhuys.co.uk wrote:

 Kate, gEdit, syn, mcedit, vim, emacs, Notepad++, Geany etc... I wouldn't
 even know where to start finding all their bug tracker information. And
 honestly, I simply don't have the time. Using .pas is just simpler.

It's mostly not the editors that have a bug, but nobody submitted a 
syntax file for .pp. It has been a while, but I believe that both
gedit and geany, which are GtkSourceview-based, can be extended by
simply copying the pas personalization file to a pp version. Same
for 'joe'.

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


Re: [fpc-pascal] Free Pascal 2.6.0 released!

2012-01-01 Thread John Coppens
On Sun, 1 Jan 2012 16:43:01 +0100 (CET)
mar...@stack.nl (Marco van de Voort) wrote:

 For Downloads, please use the FTP server at
 
 ftp://freepascal.stack.nl/pub/fpc/dist/2.6.0/



Hallo Marco!

A new happy 2012 for you and the FPC team...

Wanted to point out that the above directory is empty!

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


Re: [fpc-pascal] Dosemu problems compiling

2010-04-06 Thread John Coppens
On Mon, 5 Apr 2010 21:38:33 +0200
Jonas Maebe jonas.ma...@elis.ugent.be wrote:

  Anyone had a similar experience?
 
 As the DosEMU output says: ERROR: Please report the contents of
 ~/.dosemu/boot.log at
 http://sourceforge.net/tracker/?atid=457447group_id=49784func=browse;
 
 This is a bug in DosEMU.

I've reported the bug on the DosEmu mailing list and on the Sourceforge
bug tracker - but I have the impression that the last 4 years little or
no attention has been dedicated to either of them. I've also reported the
(other) bug on the DosBox forum.

I just copied the fpc source files to my (32bit-) notebook, where I have
dosemu installed, which I have used before to compile them under DOS. I
also installed FPC 2.4.0 there. Same problem as the one reported above.

I have the impression that this problem appeared in the upgrade from FPC
2.2.x to 2.4.x. I just noticed, because 2.2.x didn't accept a writeln of
an enumerated scalar, which 2.4.x does, apparently. But 2.2.x did start
compiling.

Any recent changes in the fpc executable that could cause the DosEmu
problem?

John

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


[fpc-pascal] Strange debugging issue

2010-04-05 Thread John Coppens
Hi all,

When trying to debug a series of events in a program, parts of source
lines disappear - apart from the fact that the execution secuence seems
very off.

This extract from the source file:

  if ch = eofchar then
sy := sps[ch]
  else begin
error(erchar);
nextch;
goto 1;
  end;

(with ch effectively = eofchar) produces the following:

654   if ch = eofchar then
(gdb) n
655 sy := sps[ch]
(gdb) n
659 to 1;
(gdb) n
661 l_read := true;
(gdb) n
662 n dbg_flags then
(gdb) n
[symbol_read] symbol: eofsy
663  symbol: ', sy);
(gdb) n

I haven't seen this kind of problem before, not in Pascal nor in C.
Why is the '... to 1' appearing in the listing?

Using FPC 2.4.0, and gdb 6.8

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


Re: [fpc-pascal] Documentation strangeness

2010-04-05 Thread John Coppens
On Mon, 5 Apr 2010 00:07:07 +0200
Graeme Geldenhuys graemeg.li...@gmail.com wrote:

 Luckily (no offence meant) the documentation doesn't change that much
 or that quickly. I'll probably keep to the same release cycle as FPC -
 whenever a new FPC is released, release new FPC INF docs too.

Hi Graeme,

Sorry for my ignorance - what are INF files? Google seems confused too.

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


Re: [fpc-pascal] Strange debugging issue

2010-04-05 Thread John Coppens
On Mon, 5 Apr 2010 16:21:33 +0200
Jonas Maebe jonas.ma...@elis.ugent.be wrote:

  I haven't seen this kind of problem before, not in Pascal nor in C.
  Why is the '... to 1' appearing in the listing?
 
 This usually means that you modified the file since it was loaded in
 the debugger.

That was it - but it seems slightly different from C. I actually had to
leave gdb and go back (probably could have reloaded).

Doesn't gdb detect source code changes? It's been a while, but I seem to
remember gdb warning about the C source file having been changed.

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


Re: [fpc-pascal] Strange debugging issue

2010-04-05 Thread John Coppens
On Mon, 5 Apr 2010 16:21:33 +0200
Jonas Maebe jonas.ma...@elis.ugent.be wrote:

 This usually means that you modified the file since it was loaded in
 the debugger.

And it still gives some strange result:

  if ch = eofchar then 
sy := sps[ch]
  else begin
error(erchar);
nextch;
goto 1;
  end;

gives:

654   if ch = eofchar then
(gdb) n
655 sy := sps[ch]
(gdb) 
659 goto 1;
(gdb) 
661 symbol_read := true;

Does this have anything to do with optimizations? (the goto isn't
actually executed). No optimizations are explicitly enabled.

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


[fpc-pascal] Dosemu problems compiling

2010-04-05 Thread John Coppens
Hello all,

After installing fpc 2.4.0 on a freedos directory, I had the following
problems:

- I tried to install using the install program, but dosemu crashed when
clicking on 'Continue'

- So I installed the base package manually, adjusted the path. Now fpc
(without arguments) starts correctly, showing all the commandline options.
Compiling a program (which compiled identically on Linux without errors),
I get a load of errors about GOTO and LABEL not being defined. 
I recompiled with -Sg, and dosemu crashed again.

I tried increasing DPMI memory (from 20 MB to about 50 MB), no difference.
The dosemu output is below.

Anyone had a similar experience?

(NOTE: I tried dosbox too. When I ran 'fpc', the screen output was
garbled. Tried several options, but couldn't get that to work).

I'm trying to get a program compiled for use under DOS+extender (or
win32). I looked up the possibility to cross-compile, but that doesn't
seem possible under x86_64 (no 32bit targets)?

Help!
John

ERROR: Fault handler re-entered! signal=11 _trapno=0xE
ERROR: cpu exception in dosemu code outside of DPMI client!
trapno: 0x0e  errorcode: 0x0007  cr2: 0x
eip: 0x004a2cc1  esp: 0x7fff16e2d270  eflags: 0x00010202
cs: 0x0033  ds: 0x013f  es: 0x013f  ss: 0x002b
ERROR: Please report the contents of ~/.dosemu/boot.log at
http://sourceforge.net/tracker/?atid=457447group_id=49784func=browse
It would be even more helpful if would recompile DOSEMU and reproduce this
bug with debug on in compiletime-settings.
Page fault: write instruction to linear address: 0x
CPU was in user mode
Exception was caused by insufficient privilege
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Documentation strangeness

2010-04-05 Thread John Coppens
On Mon, 5 Apr 2010 17:25:44 +0200
Graeme Geldenhuys graemeg.li...@gmail.com wrote:

 Wikipedia has some information on IPF.
   http://en.wikipedia.org/wiki/Information_Presentation_Facility

Thanks for the extensive answer, Graeme!

I'm sure the selection of IPF/INF caused some discussion at the time,
particularly at a time where xml is the magic recipe for everything ;-)

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


Re: [fpc-pascal] Documentation strangeness

2010-04-04 Thread John Coppens
On Sun, 4 Apr 2010 12:24:36 +0200 (CEST)
Michael Van Canneyt mich...@freepascal.org wrote:

 The community version (with comments) should be simply deleted; 
 it causes only confusion and more work without any benefit.
 
 I have removed the links to them.

Proof of concept: I hadn't found the 'good' one - just the old version.
Thanks for deleting ;-)

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


[fpc-pascal] Documentation strangeness

2010-04-03 Thread John Coppens
Hi people,

I was using the Pascal reference manual, and found that 'fi' was replaced
by some strange character... Modifiers came out as Modi�ers etc. This
seems to have happened all over the document at:

http://community.freepascal.org:1/docs-html/ref/ref.html

This is just a little frustrating, but maybe it's an easy thing to avoid
and regenerate the document. If it's more work-intensive, I offer my help
in editing...

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


Re: [fpc-pascal] Documentation strangeness

2010-04-03 Thread John Coppens
On Sat, 3 Apr 2010 20:36:56 +0200 (CEST)
mar...@stack.nl (Marco van de Voort) wrote:

 The refered documentation (on the FPC community server) is from 2006:
 
 Reference guide for Free Pascal, version 2.2
 Document version 2.0
 August 2006

Yep... But that is the manual which is on-line at the moment. I thought
it would be up-to-date, but it seems the 2.4 package has a much newer
html version.

Wouldn't it be advisable (and probably save a lot of questions) to get
the online version updated?

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


Re: [fpc-pascal] Insert into ... mysql

2009-06-28 Thread John Coppens
On Sun, 28 Jun 2009 15:42:04 -0500
César Espinoza cesarespinozas...@gmail.com wrote:

 But I can't (may be I dont know :-( ) insert data in a table

If you can query, but not insert, there are a few things to check:

- Is the syntax of your insert correct? I mean, does column 'lugar' exist,
  and is it a varchar column, etc.?
- Are you allowed to insert? (Check the privileges for the person
  as who you log in. Insert, update, select, all have separate 'enables')
- What is the message returned by mysql_error?

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


Re: [fpc-pascal] GRAPHICS HELP : PLEASE PLEASE????

2009-06-28 Thread John Coppens
On Sun, 28 Jun 2009 18:23:12 -0700 (PDT)
Zachary Marlow zachary_mar...@yahoo.com wrote:

 Well 
   Like How to draw a circle , I just need some example code please 

Check this tutorial:

http://pascalprogramming.byethost15.com/lesson8.php

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


Re: [fpc-pascal] BoolToStr() with correct locale output

2009-06-26 Thread John Coppens
On Fri, 26 Jun 2009 15:54:55 +0100
Henry Vermaak henry.verm...@gmail.com wrote:

  How come nobody ever noticed this? Does everybody only write English
  programs. :-)

I _hate_ to think of the consequences of localization of those strings.
Have we had enough of the . and , problem? I don't think we need another
cause for incompatibilities in data files. Localization should be done by
the application program which assigns a meaning to the variable, not by
Pascal.

Boolean values tend to represent too many things, apart from TRUE and
FALSE. Like FULL and EMPTY, FAST and SLOW, and so on. To me it makes
sense that booleans are stored as bits, and, if _really_ necessary, shown
as TRUE or FALSE, mainly for debugging purposes. Wirth's Pascal definition
specifies the use of TRUE and FALSE.

Just my $.02

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


Re: [fpc-pascal] IE 200307043

2009-05-25 Thread John Coppens
On Mon, 25 May 2009 21:09:44 +
Prince Riley wmarketi...@gmail.com wrote:

 Type checking for valid
 pointer arithmetic and the difference between a 'null' or empty pointer
 and one that has the lowest value of it's type.

Maybe the use of 'nil' in an expression should not be allowed at all
(except comparisons). 

As I understand its meaning is that it sets (any) pointer to an invalid
value. But I seem to have read that in case of microcontrollers 'NULL' at
times means $, and, according to Wikipedia, some computers assign the
max negative value to NULL:

http://en.wikipedia.org/wiki/Null_(computer_programming)

So, any reliance on nil being 0 (or any definite value) would seem
unreliable (sorry for the pun).

Taking this further, nil = prt(0, 0) shouldn't be true (though in most
programming languages they are equivalent, and in case of a PC-like
environment it's complicated to represent a really 'invalid' scalar
value).

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


Re: [fpc-pascal] Including binary data making easy

2009-03-23 Thread John Coppens
On Mon, 23 Mar 2009 18:22:15 +0200
Graeme Geldenhuys graemeg.li...@gmail.com wrote:

 I have been using bin2obj for two years now. It works perfectly for
 me, even though it's a (occasional) two step process. My application
 changes more than the resource I include.

... and you can add the conversion into the Makefile, so the conversion
happens automatically when the data changes.

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


Re: [fpc-pascal] Can I encorperate PDF files

2009-02-20 Thread John Coppens
On Fri, 20 Feb 2009 12:35:07 -0500
John Youngquist jo...@iaw.com wrote:

 I would like to add a help facility that would search a topic in a
 PDF format manual and display the appropriate page. It there
 Module to read and search PDF file available.

An easy solution in Linux would be to call xpdf from the program. You can
specify the PDF on the line, and either a page number to jump to, or a
named destination (if they were defined inside the pdf).

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


Re: [fpc-pascal] DateTimeToUnix bug?

2008-12-30 Thread John Coppens
On Tue, 30 Dec 2008 09:25:29 -0700
Seth Grover sethdgro...@gmail.com wrote:

 It seems to me that 09-16-1989 12:00:01 should be 621950401, not
 621950400.

This seems to be rounding error - if you put 1 ms (milisecond) in the
seconds test, the result comes out right. For consecutive seconds, and
ms = 0:

09-16-1989 12:00:00 = 621950400 = 09-16-1989 12:00:00
09-16-1989 12:00:01 = 621950400 = 09-16-1989 12:00:00
09-16-1989 12:00:02 = 621950402 = 09-16-1989 12:00:02
09-16-1989 12:00:03 = 621950403 = 09-16-1989 12:00:03
09-16-1989 12:00:04 = 621950403 = 09-16-1989 12:00:03
09-16-1989 12:00:05 = 621950404 = 09-16-1989 12:00:04
09-16-1989 12:00:06 = 621950406 = 09-16-1989 12:00:06
09-16-1989 12:00:07 = 621950407 = 09-16-1989 12:00:07
09-16-1989 12:00:08 = 621950407 = 09-16-1989 12:00:07
09-16-1989 12:00:09 = 621950408 = 09-16-1989 12:00:08
09-16-1989 12:00:10 = 621950410 = 09-16-1989 12:00:10
09-16-1989 12:00:11 = 621950411 = 09-16-1989 12:00:11
09-16-1989 12:00:12 = 621950411 = 09-16-1989 12:00:11
09-16-1989 12:00:13 = 621950412 = 09-16-1989 12:00:12

with ms = 1:

09-16-1989 12:00:00 = 621950400 = 09-16-1989 12:00:00
09-16-1989 12:00:01 = 621950401 = 09-16-1989 12:00:01
09-16-1989 12:00:02 = 621950402 = 09-16-1989 12:00:02
09-16-1989 12:00:03 = 621950403 = 09-16-1989 12:00:03
09-16-1989 12:00:04 = 621950404 = 09-16-1989 12:00:04
09-16-1989 12:00:05 = 621950405 = 09-16-1989 12:00:05
09-16-1989 12:00:06 = 621950406 = 09-16-1989 12:00:06
09-16-1989 12:00:07 = 621950407 = 09-16-1989 12:00:07
09-16-1989 12:00:08 = 621950408 = 09-16-1989 12:00:08
09-16-1989 12:00:09 = 621950409 = 09-16-1989 12:00:09
09-16-1989 12:00:10 = 621950410 = 09-16-1989 12:00:10
09-16-1989 12:00:11 = 621950411 = 09-16-1989 12:00:11
09-16-1989 12:00:12 = 621950412 = 09-16-1989 12:00:12

John

I slightly modified the test program:

program Project1;

uses
  Classes,
  SysUtils,
  DateUtils;

var
  utime  : longword;
  sec : word;
  currentDt : TDateTime;
  convertedDt : TDateTime;

begin
  for sec := 0 to 59 do begin
currentDt := EncodeDateTime(1989, 9, 16, 12, 0, sec, 1);
utime := DateTimeToUnix(currentDt);
convertedDt := UnixToDateTime(utime);
writeln(FormatDateTime('mm/dd/ HH:nn:ss', currentDt) + ' = ' +
  IntToStr(utime) + ' = ' +
  FormatDateTime('mm/dd/ HH:nn:ss',
  convertedDt));
  end;
end.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] DateTimeToUnix bug?

2008-12-30 Thread John Coppens
On Tue, 30 Dec 2008 09:25:29 -0700
Seth Grover sethdgro...@gmail.com wrote:

 Is this broken or am I missing something?

I suspect the problem is in this function:

Function SecondsBetween(const ANow, AThen: TDateTime): Int64;
begin
  Result:=Trunc(Abs(ANow-AThen)*SecsPerDay);
end;

from the dateutil.inc rtl library. The trunc function is no garantee for
a correct result, and can err downwards. I think it should be rounding
function, or add 0.0005 seconds (1/2 milisecond). Of course this also
depends on the sign of the result.

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


Re: [fpc-pascal] Unicode file routines proposal

2008-06-30 Thread John Coppens
On Mon, 30 Jun 2008 10:03:18 -0300
Felipe Monteiro de Carvalho [EMAIL PROTECTED] wrote:

 On Mon, Jun 30, 2008 at 9:55 AM, Graeme Geldenhuys
 [EMAIL PROTECTED] wrote:
  I thought UTF-8 was prefered. Hence the reason Lazarus followed the
  UTF-8 route in LCL and Unicode support.
 
 UTF-8 is much better for the LCL because it just fits much better in
 out existing codebase.

This may have been discussed before - but should the encoding not be
dependent on the locale? What would happen if I write a FPC program,
if the internal routines are, eg., UTF-16, and my locale is set to
en_US.UTF8?

Anyway, I have the impression that most of Linux is utf-8 oriented by now.

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


Re: [fpc-pascal] Empty string

2008-03-07 Thread John Coppens
On Fri, 7 Mar 2008 15:09:36 +0100
Damien Gerard [EMAIL PROTECTED] wrote:

 Consequently, it can not be the same code. Otherwise I understood  
 nothing :)

'' is an empty string, _and_ its length is zero (of course). So the
compiler is so intelligent as to replace  length(s) = 0, or s = ''
by the same code.

Normally s = '' would be a very slow way to check for an empty string, so
the compiler optimizes this automatically.

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


Re: [fpc-pascal] Extension .pp or .pas

2008-01-11 Thread John Coppens
On Fri, 11 Jan 2008 14:55:40 +
Matt Emson [EMAIL PROTECTED] wrote:

 Was .pp the UNIX standard?

Suspecting the analogy with .c and .cc, I guess it was .p in the non-OO
era and .pp with objects.

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


Re: [fpc-pascal] serial.pp - I can't talk to modem

2008-01-02 Thread John Coppens
On Wed, 2 Jan 2008 16:15:33 +0200
Graeme Geldenhuys [EMAIL PROTECTED] wrote:

  SerSetParams(serialhandle, 2400, 8, NoneParity, 1,
  [RtsCtsFlowControl]);

Hi...

I seem to recall (vaguely) that modem comms were (by default) Even
parity, and 7 bits. Can't recall default speed though. Could that be the
reason?

How is your minicom configed? 

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


Re: [fpc-pascal] can we have fpc's doc in chm format?

2007-12-03 Thread John Coppens
On Mon, 3 Dec 2007 14:00:14 +0200
Adrian Maier [EMAIL PROTECTED] wrote:

 I'm still unable to to copy text in xpdf.   But I've just installed
 evince and copying text
 works .  Thanks for telling me about it , Graeme !

xPDF version 3.01 permits copying. It's a little awkward, as the
selection box is a graphic rectangle. But with a little experience,
copying works fine (paste with middle button), and xpdf is sooo fast!

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


Re: [fpc-pascal] fpnanosleep (again)

2007-11-08 Thread John Coppens
On Thu, 8 Nov 2007 13:43:48 +0100
Rainer Stratmann [EMAIL PROTECTED] wrote:

 http://en.wikipedia.org/wiki/RDTSC

Interesting... I'm guessing gettimeofday would use this register to
obtain the hi-res time it provides - does it?

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


[fpc-pascal] fpnanosleep (again)

2007-11-07 Thread John Coppens
Hi all.

I need a small delay in my program, which bitbangs an i2c interface
connected to the parallel port. This is mainly for educational purposes,
so please don't question the wiseness of this decision.

Is there any simple way (short of writing a kernel module) of delaying
less than the HZ value? Weirdly, fpNanosleep seems to delay 8.3 ms
minimally (weird, 'cause that's less than the HZ value). 

I'm using a 2.6 kernel.

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


Re: [fpc-pascal] fpnanosleep (again)

2007-11-07 Thread John Coppens
On Wed, 7 Nov 2007 19:27:39 -0300
John Coppens [EMAIL PROTECTED] wrote:

 Is there any simple way (short of writing a kernel module) of delaying
 less than the HZ value? Weirdly, fpNanosleep seems to delay 8.3 ms
 minimally (weird, 'cause that's less than the HZ value). 

Just an extra note: delay(1) seems to delay 4.1 ms, so it _does_ seem to
be possible to do less than 8.3?

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


Re: [fpc-pascal] fpnanosleep (again)

2007-11-07 Thread John Coppens
On Wed, 7 Nov 2007 19:27:39 -0300
John Coppens [EMAIL PROTECTED] wrote:

 Is there any simple way (short of writing a kernel module) of delaying
 less than the HZ value?

Very unelegant, but it works:

procedure usleep(time: longint);
var
  tv: timeval;
  tz: timezone;
  diff,
  ref: clong;
begin
  fpGetTimeOfDay(@tv, @tz);
  ref := tv.tv_usec;
  repeat
fpGetTimeOfDay(@tv, @tz);
diff := tv.tv_usec - ref;
if diff  0 then
  diff := diff + 100;
  until diff  time;
end;

in case someone is interested.

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


[fpc-pascal] Serial port interrupts?

2007-10-05 Thread John Coppens
Hello people.

To make a debugging tool, I need to time changes on the serial port
control and status lines on a Linux machine. The serial port hardware has
this possibility, but is it possible to program this in a more
or less high-level way? I did this a long time ago in DOS. 

I've looked at several libraries, but none seem to give access to
line/status change events in realtime.

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


Re: [fpc-pascal] How to analyze a core dump?

2007-06-10 Thread John Coppens
On Sun, 10 Jun 2007 21:30:09 +0200
Luca Olivetti [EMAIL PROTECTED] wrote:

 I'm trying to debug a segment violation, I compiled the program with
 -g, but analyzing the core dump isn't really helpful, maybe the
 warning can't read pathname for load map is the cause? Or it's
 possible that it's caused by some of the c libraries used having no
 debug symbols? Any hint?

I'm not too experienced in this, but I suspect a good first step would be
to ask for a backtrace (bt) in gdb, after the segfault occured. You'll
see the steps that led to the actual segfault, starting from the main
program till the library function that failed. Don't immediately suspect
the library - go back to the last line of your program and check if all
things are normal at _that_ point.

AFAIK, core dumps are not really related with gdb, but are generated by
the kernel, and should be the last step to fall back on. A backtrace in
gdb is generally more helpful.

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


Re: [fpc-pascal] Web Service Toolkit - Notify the Client

2007-06-03 Thread John Coppens
On Sun, 3 Jun 2007 16:55:23 +0200 (CEST)
Michael Van Canneyt [EMAIL PROTECTED] wrote:

  Is it possible to delay a SOAP call a few seconds at the service
  provider (until new data is available)? Hmm, this reveals the question
  what are the timeouts for TCP/IP connection and for the web services? 
 
 I think a few seconds are possible, a timeout is usually longer than
 that. The webservices do not specify any values for timeouts. I'm not
 sure whether the HTTP protocol has such definitions, but I would be 
 surprised if it had.

If using the HTTP protocol, it's possible to define a refresh time of x
seconds using a meta-tag:

META HTTP-EQUIV=refresh
   CONTENT=3;URL='http://www.homepage.com/spot3.html'

This is quite popular with webcams and such. But this is of course not
the definition of a timeout value, you would have to know when the next
value is due.

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


Re: [fpc-pascal] Congratulations to FPC!

2007-03-27 Thread John Coppens
On Mon, 26 Mar 2007 15:42:05 +0700
Bisma Jayadi [EMAIL PROTECTED] wrote:

 I knew about it too as I'm a member of Morfik Pioneer. Just want to
 share a good news to others who doesn't know yet about Morfik. :)

Thanks for the heads-up, but the site at Morfik can use a little work to
convince potential customers:

1) On the home page, the Flash takes precedence over the drop-down
menues, so only the first 2-3 items are visible.

2) On the download page, the size of the page doesn't adapt to the
contents, so at least three of the text boxes show incomplete information.
(This is on Firefox 1.5.0.9, with the minimum text size)

3) Even though there's a Linux logo at the bottom, I can't find a Linux
version to download. (Maybe that has to do with 2))

4) I cannot find how to send anything to the Morfik site (no evident
feedback address or form), so I can't report these things (maybe
registering is needed?)

This is just meant as constructive criticism...

John
PS: The static FPC logo is nice, but yells for an italic font for the
'free pascal' text to convey the 'speed'.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Congratulations to FPC!

2007-03-27 Thread John Coppens
On Tue, 27 Mar 2007 21:49:11 +0700
Bisma Jayadi [EMAIL PROTECTED] wrote:

  3) Even though there's a Linux logo at the bottom, I can't find a
  Linux version to download. (Maybe that has to do with 2))
 
 Morfik IDE runs ONLY on windows platforms but the executable output can
 be run on other platforms via cross compilation. This is where FPC
 shines. :)

Ok... Not interested, then. I can't imagine installing Windows to develop
Linux apps. I'd never trust my machine again ;-)

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


Re: [fpc-pascal] Congratulations to FPC!

2007-03-27 Thread John Coppens
On Tue, 27 Mar 2007 22:48:00 +0700
Bisma Jayadi [EMAIL PROTECTED] wrote:

 I even proposed a more radical solution for the next step:
 porting the Morfik IDE to a Morfik (web) app. ;)

I hope you don't mean 'over the web'. I just recovered my ADSL link, so I
can start developing again? Not for me either. 

Even with everything local, loading 75+M of Java to have a decent editor
(which still isn't as decent as the one I use), doesn't sound
productivity-enhancing.

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


Re: [fpc-pascal] Congratulations to FPC!

2007-03-27 Thread John Coppens
On Tue, 27 Mar 2007 20:59:50 +0200
Florian Klaempfl [EMAIL PROTECTED] wrote:

  Even with everything local, loading 75+M of Java to have a decent
  editor
 
 Ajax has nothing to do with Java applets.

No, I meant that a complete HTML based IDE would need a local editor,
which I suppose wouldn't be written in Ajax (more correctly Javascript)?

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


Re: [fpc-pascal] USB serial interface

2006-12-26 Thread John Coppens
On Tue, 26 Dec 2006 20:23:56 +0100
Rainer Stratmann [EMAIL PROTECTED] wrote:

 We tried USB converters with prolific chipset and it hangs up then, so
 FTDI chips would be better. I read also somewhere a lack of latency.
 May be it is also a question of the Kerneldriver and the driver will
 improve more in the future.

I have two Prolific 2303 serial converters without problems. There is
native USB support in the kernel (2.6.17). I have run them at 38400. I am
interested in your problems - maybe I can prevent some future problem.

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


Re: [fpc-pascal] even linus torvalds prefer pascal over c

2006-12-02 Thread John Coppens
On Sat, 2 Dec 2006 19:39:34 +0100 (CET)
Daniël Mantione [EMAIL PROTECTED] wrote:

 However, assembler coded is not portable. A hand optimized Pascal 
 based solution with goto statements might be preferable over assembler 
 code. For example, in the file rtl/unix/video.pp , the procedure 
 update_vcsa uses a goto for speed reasons.

Yes... I understand that, of course. But my arguments against this are:

1) Except the compiler writers, few people know what code is generated
   for which source (should they know?). How do I know that a goto is
   really translated as a jump? I'm no expert, I did see that in many
   cases ifs, cases, whiles etc, are sufficiently 'recoded' by the 
   compiler such as to make it difficult to garantee that (or know if)
   the goto is reached fast enough to matter.

2) Compiler semantic analysis is evolving (I imagine), so I'd suspect
   that optimising is also improving continuously...

3) I also believe that gotos are somewhat like guns. If they're available,
   it's more probable that people shoot themselves in the foot (or worse).

Mind, I don't want to remove gotos. I'm all for free choice. But I'm
still very much a proponent to discourage its use for fledgling
programmers.

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-20 Thread John Coppens
On Mon, 17 Jul 2006 21:12:31 +0200
Florian Klaempfl [EMAIL PROTECTED] wrote:

 I'am currently thinking about implementing OpenMP support in FPC.

Florian,

Have you looked at Pascal-FC (a language developped based Pascal/0, I
believe, by Alan Burns)? I've used it to teach multiprogramming, and it
incorporates many of the items which are available in several other
MP languages (such as ADA). It's probably too basic, but there may be
some useful ideas.

Is _is_ very clean though. No {$xxx's etc...

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


Re: [fpc-pascal] Common OpenMP syntax?

2006-07-20 Thread John Coppens
On Thu, 20 Jul 2006 21:11:49 +0200
Vinzent Höfler [EMAIL PROTECTED] wrote:

 Alan Burns? That's a name which rings a bell. You could have send the 
 URL, though. ;)
 
 http://www-users.cs.york.ac.uk/~burns/pf.html
 
 Hmm, and taking a peek look at the examples, it doesn't really surprise 
 me, that this just looks like the Pascal version of Ada's tasking.

Hi Vinzent.

Yes - quite famous. 

But apart from the ADA style resources, it also implement a number of
other tools, such as channels/remote invocation, etc. The cobegin/coend
pair to specify concurrency is elegant, though maybe somewhat 'flat'.

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


Re: [fpc-pascal] Strange error message?

2006-07-07 Thread John Coppens
On Fri, 07 Jul 2006 20:14:13 +0200
Vincent Snijders [EMAIL PROTECTED] wrote:

 or compile your code in tp mode (fpc -h for help about command line 
 parameters).
 
 Vincent
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Thanks both!

I hope this gets to the list. I had found the problem just minutes after
putting the question on the net (as frequently happens), and sent a notice
to the list. I had to leave, so I didn't notice that the message bounced:

fpc-pascal@lists.freepascal.org: host lists.freepascal.org
[193.224.143.26] said: 554 Service unavailable; Client host
[208.97.132.5] blocked using bl.spamcop.net; Blocked - see
http://www.spamcop.net/bl.shtml?208.97.132.5 (in reply to RCPT TO command)

Again, appreciated...

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


[fpc-pascal] Redirect under Linux

2006-06-27 Thread John Coppens
Hi all...

I was testing a program I wrote in FPC which directs the cursors (using
crt), by redirecting the output to a file, but was surprised that the
escape sequences weren't in the file.

Checking the source of the crt units, I found that when redirecting, the
sequences are switched off.

Is there motive for this behaviour? I just tested the same program
under TP7, and, when using crt, redirection isn't possible at all - which
is quite logical. Under linux, non-pascal programs do not distinguish
between being redirected or not (also logical).

I couldn't find a simple way to disable this (short of modifying the
crt.pp source code and recompiling)... I need the output of the program to
have the escape sequences, as I'd like to use them to feed a terminal
emulator program.

BTW - beautiful new website!

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


Re: [fpc-pascal] aterm won't run fp

2006-05-02 Thread John Coppens
On Tue, 25 Apr 2006 08:52:05 +0200 (CEST)
[EMAIL PROTECTED] (Marco van de Voort) wrote:

  Can anyone tell me what's missing to get aterm to run fp?
 
 Implementation of the Xterm terminal standard ? :)
 
 Debugging startup (possibly using a simpler example like installer
 first), is the only real solution I think.

Just in case someone bumps into the same problem - Thanks to some
suggestions on the IRC channel, I solved the aterm problem with:

aterm -tn xterm -e fp

Surprisingly 'aterm -tn rxvt -e fp' does not work (but rxvt -e fp does
work!)

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


Re: [fpc-pascal] google summer of code?

2006-04-27 Thread John Coppens
On Thu, 27 Apr 2006 13:20:39 -0300
Flávio Etrusco [EMAIL PROTECTED] wrote:

 Or because opensource world tends to be C-centric, or because FPC
 didn't make to the news a lot in USA, or because... we could go on for
 some time.

This is beginning to show some similarities to the DMOZ (Google's open
directory project) where several scandals surfaced along the way. Sites
were turned down without motivation, and monitors (called editors
there) were chosen at the whim of supervisors.

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


Re: [fpc-pascal] ParamStr(0) bug??

2006-04-24 Thread John Coppens
On Mon, 24 Apr 2006 13:35:40 -0400
Bob Richards [EMAIL PROTECTED] wrote:

 I have written a program who's behavior depends on the name by which it
 has been invoked. This is not uncommon, for instance sendmail invoked
 as mailq behaves in a completely different way.

You could try to access the environment variables - the '_' variable
contains the command used to start the program. Just tested it - it shows
the link.

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


[fpc-pascal] aterm won't run fp

2006-04-24 Thread John Coppens
Hi all

Even though I don't have a solution to the previous problem, I already
have another one.

A while ago I tried 'fp' and didn't get anything. Not having time, I
dropped the issue. Now I tried again, and decided to dig a little deeper:

1) in an 'aterm', calling fp doesn't show _anything_, just waits for
Ctrl-C to exit to the promps (no menu, no gibberish.)

2) in a real 'xterm', fp works normally - I don't like xterms, because I
had some problems with multiple charsets and I haven't found out to make
them transparent.

3) I tried with 'aterm --font vga', then start fp - exactly the same. The
font changed to vga though, but no fp in sight. Tried several other
fonts, switched off 'aterm' transparence, just in case. 

4) Also tried to add -tn linux, though that's the default.

Can anyone tell me what's missing to get aterm to run fp?

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


[fpc-pascal] eof strangeness

2006-04-23 Thread John Coppens
Hi all.

While modifying some older programs, I found a strange effect with eof
(input). When calling eof(input), the program needs an enter key to
continue. I just downloaded 2.0.2, with the same result.

The definition of eof (according to the FPC docs) is that it immediately
returns... which is what I need. Can anyone suggest a solution for this?

program testeof;

begin
  if eof then
writeln('EOF found')
  else
writeln('No EOF found');
end.

This sample program doesn't return till enter is pressed.

TIA,
John

Note: first send to the list didn't get published...
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Type confusion in GDB?

2005-11-15 Thread John Coppens
Hi all.

I was debugging a program and found that the contents of an 'array of
integer' was shown wrong... It took me quite a while to realize that GDB
was showing 32-bit integers, while the pascal program was using 16-bit
ones (at least think is happening):

Assign 1 to firstcol[0]:

(gdb) print firstcol
$27 = {1, 0 repeats 19 times}

Assign 81 to firstcol[1]:

(gdb) print firstcol
$28 = {5308417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0}

(NOTE that here the 80 actually belongs to another variable (lastcol)).
Printing the array in hex gave me the clue:

$30 = {$510001, $0, $0, $0, $0, $0, $0, $0, $0, $0, $50, $0, $0, $0, $0,
$0, $0, $0, $0, $0}

The $51 is actually the 81...

I think the confusion comes from the fact that firstcol is defined as:

firstcol: array[1..nspecmax] of 1..ncolmax;

which is a range type, not recognized by GDB, and which is 16 bit (in
this case, could probably be even 8 bit).

This problem is not mentioned in the 'Caveats'...

Hope this is of some help.
John
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Lazarus and FPC integration

2005-10-30 Thread John Coppens
On Sun, 30 Oct 2005 15:50:00 -0800
L505 [EMAIL PROTECTED] wrote:

 Your search - Polymorphism with primitive data types - did not match
 any documents. 

Don't use the s... Too restrictive.

Without them, 

Results 1 - 10 of about 266,000 for Polymorphism with primitive data types

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


[fpc-pascal] IDE problems and crosscompiling

2005-10-27 Thread John Coppens
Hi guys...

I wish it were as simple as the docs say.

On Linux, I type 'fp' and nothing happens - not even the first text
appears on the screen, no CPU activity... Ctrl-C exits.

I even tried to recompile the entire source code, ran the fp there, same
(lack of) luck.

I don't care much for the IDE, but I wanted to cross compile a program
for DOS on my Linux machine, and found 'System unit missing'. I had
installed the complete package automatically, but that contains only the
i386-linux libraries, I suppose.

I cannot find any indication how to make 'make' compile a win32 or dos
version of the system unit. I've checked the Wiki, docs... Am hitting my
head against the monitor now.

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


Re: [fpc-pascal] IDE problems and crosscompiling

2005-10-27 Thread John Coppens
On Thu, 27 Oct 2005 21:05:56 +0200
Vincent Snijders [EMAIL PROTECTED] wrote:

 Maybe a bit outdated, but this information was gold about a year ago,
 http://wiki.lazarus.freepascal.org/index.php/Cross_compiling_for_Win32_under_Linux
 
 Also the buildfaq.pdf is a good (and up to date) read, if you want to 
 know details. Very handy if thing don't work right away.
 http://www.stack.nl/~marcov/buildfaq.pdf
 
 Vincent.

Hallo Vincent.

Thanks for the info. I don't know how I passed over that item. I guess I
didn't search in the Lazarus Wiki... Maybe this info - which isn't
Lazarus-specific - should really be in the FPC-Wiki? Or at least
crosslinked?

I solved the problem temporarily, compiling the code under DOSEMU. Not
too elegant, but it gives me the possibility to test the .exe's too. 

BTW, the IDE under dosemu crashes violently. I read something about
that while looking for the other stuff...

Again thanks,
John
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Array of Char

2005-08-18 Thread John Coppens
On Thu, 18 Aug 2005 07:24:46 +0200
Carsten Bager [EMAIL PROTECTED] wrote:

 We are moving from another Pascal compiler where this is  
 allowed. 
 -- 

Type 
   txt_typ = packed array[0..1] of char; 
 
Const 
   txt1: txt_typ = '12'; 

without the parenthesis should work.

John

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


Re: [fpc-pascal] Pointers

2005-07-27 Thread John Coppens
On Wed, 27 Jul 2005 20:55:34 -0300
Daniel Franzini [EMAIL PROTECTED] wrote:

 Hi everyone
 
 I'm just trying to compile and execute a simple example from a
 graphics programming tutorial under FPC. Here is the code
 

Note that those addresses (like $a000) are all things from the 16-bit
world. I'm not sure how far these are emulated correctly if you are
running in a 32-bit world. Addresses for graphics cards are way different
there, easier to use, but different from card to card.

John

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


Re: [fpc-pascal] FPC and CD-ROMs

2005-07-25 Thread John Coppens
On Mon, 25 Jul 2005 17:14:02 +0300
Alexey Pavluchenko [EMAIL PROTECTED] wrote:

 Hello Pianoman,
 
 Monday, July 25, 2005, 1:35:21 PM, you wrote:
 
 P Hi everyone. I have one simple question : How can i eject/close
 P certain CD-ROM drive? I write Certain because I ave more than one so
 P I have to specify which.
 P Is there some API call to do this? I searched the help files but I
 P didn't found very much about it.
 
 Under Win32 you should use DeviceIOControl function. The device should
 be opened first with CreateFile. Refer to the WinAPI reference (MSDN)
 for details.
 
 Under unices the approach is similar, the respective functions are
 open() and ioctl(). Again, see specific system docs for details.

You could also simply call the 'eject /dev/hdc' and 'mount /dev/hdc'
system commands under Un*x.

John

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


Re: [fpc-pascal] String to Unicode?

2005-07-23 Thread John Coppens
On Sat, 23 Jul 2005 17:00:15 +0200
Thomas Zastrow [EMAIL PROTECTED] wrote:

 Hi there,
 
 I'm producing some XML-Output with a FPC-program. The problem is that 
 there are special charakters like  and  in the content of some tags, 
 also some german special charakters which has to be encoded into gt; 
 and so on.
 
 Are there any functions like String to unicode or so for doing this 
 automatically??

Hi Tom...

Is there some confusion? I believe you mean html entities ( gt; is an
html entity, not unicode). Did you check the libxml2 library? This library
has the necessary escaping routines to hide those special routines.

On the other hand, character set coding can also be done with the library.

John

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


Re: [fpc-pascal] System.Write broken?

2005-07-13 Thread John Coppens
On Wed, 13 Jul 2005 16:50:03 -0500
Elio Cuevas Gómez [EMAIL PROTECTED] wrote:


 The code to read the file looks like this (yeah, bad programming i
 know): for j := 0 to MAX_MAPY do
 for i := 0 to MAX_MAPX do
   Read(MapFile, Mapa[i, j]);


How is Mapa declared? If as integers, it should work. This does not work
with strings.

It'd be a little more elegant if you do:

for j := 0 to MAX_MAPY do begin
  for i := 0 to MAX_MAPX do
Read(MapFile, Mapa[i, j]);
  ReadLn(MapFile);
end;

garanteeing you read MAX_MAPY lines

John

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


Re: [fpc-pascal] System.Write broken?

2005-07-13 Thread John Coppens
On Wed, 13 Jul 2005 19:55:33 -0500
Elio Cuevas Gómez [EMAIL PROTECTED] wrote:


 I tried your version, but didn't make much diference. Looks like Write
 is indeed broken, i'll report it as a bug. Thanks for all your help :).

I tried it here - works fine for me (See code tested below). A doubt: did
you correctly set the for loops... 0..MAX_MAPY is actually one more that
you might expect! As I cannot see the definition of MAX_MAPY, I don't
know if they're correct.

Anyways, this works (note 1..5 in array def, and loops):

program test;

var
  Map: array [1..6, 1..6] of integer;
  i, j: integer;
  MapFile: text;

begin
  assign(MapFile, 'test.map');
  reset(MapFile);
  for j := 1 to 6 do begin
for i := 1 to 6 do
  Read(MapFile, Map[i, j]);
  end;
  for j := 1 to 6 do begin
for i := 1 to 6 do
  write(Map[i, j]:3);
writeln; 
  end;
  close(MapFile);
end.


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


Re: [fpc-pascal] Something like Is a number?

2005-07-08 Thread John Coppens
On Fri, 08 Jul 2005 16:39:05 +0200
Thomas Zastrow [EMAIL PROTECTED] wrote:

 Hello,
 
 I'm converting some strings with strtoint into integers. But
 sometimes the string can't be converted to a number. Is there a
 function which takes a string and tells me if it is possible or not to
 convert it into a number? Something like IsANumber(string)
 
You can use val(str, int/real, err)

if err is 0, the string was converted to an integer or real (depending on
the type of int/real.

John

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


Re: [fpc-pascal] Runtime error 123

2005-05-04 Thread John Coppens
On Wed, 04 May 2005 10:33:46 -0700
Mark Emerson [EMAIL PROTECTED] wrote:

 What is Runtime error 123?
 
 It's not documented in the User Manual, but appears to be associated
 with the eof function.
 
 Mark

...
122 'Quota exceeded',
123 'No medium found',
124 'Wrong medium type'

I found this in the rtl for Linux. (errors.pp). but the corresponding
symbols in errors.inc are not defined for 123 and 124.

John

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

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


Re: [fpc-pascal] Runtime error 123

2005-05-04 Thread John Coppens
On Wed, 04 May 2005 12:26:54 -0700
Mark Emerson [EMAIL PROTECTED] wrote:

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

Many more errors possible in Windoze, it seems. 
 
ERROR_INVALID_NAME = 123;

Check in fpc-1.0.10/rtl/win32/wininc/errors.inc for a list.

John

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


Re: [fpc-pascal]

2005-05-04 Thread John Coppens
On Thu, 5 May 2005 09:19:27 +0530
Anandu R Suri [EMAIL PROTECTED] wrote:

 I am writing an operating system using your Free Pascal Compilier
 1.0.10. Most of my code is based on the IA32 opcodes in $ASMMODE INTEL.
 I have two problems, both are of importance.
 
 1. The very basic problem is with the video driver. Whenever I try to
 write to the Video memory either there is no reponse, or I receive a
 run time error 216. I tried all possibilities of using an absolute
 array, pointers, and even FillWord, nothing works out.

Are you sure the video card is in text mode? The code you're using is
very specific to 16-bit IBM-like PCs explicitly in mode 3 (color, 80x25).
If you are in 32- bit mode, the memory will probably be elsewhere and
text mode can even be emulated by graphics. If you want the program to be
more or less portable you shouldn't be accessing the video directly. Use
INT 10 functions.

John

 2. Since my Operating System will be Object Oriented, the compilation
 consists of calling a FPC_HELP_CONTRUCTOR which in turn calls the built
 in AsmGetMem function. But during the system initialization process
 there will be no memory manager. Is there a possiblity of constructing
 an object at a predetermined location like in C++?
 
 Var x, y: Byte
 
 Procedure ClrScr; Assembler; [Public, Alias: 'CLRSCR'];
 ASM
 mov edi, $B8000
 mov  eax, $07200720
 mov  ecx, 2000
 rep
 stosw
 mov  x, 0
 mov  y, 24
 End;
 
 This piece of code always gives a RTE 216.
 
 
 
 
 
 
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

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


Re: [fpc-pascal] Error: cannot find -lcurses

2005-04-24 Thread John Coppens
On Sun, 24 Apr 2005 16:37:12 +0200
Greenblatt [EMAIL PROTECTED] wrote:

 Hi,
 
 I have a problem with FreePascal 1.0.10 under SuSE 9.1. If I want to
 compile source code, which makes use of the keyboard unit, I get the
 following error message:
 
 /usr/bin/ld: cannot find -lcurses
 Pong(46) Error: Error while linking
 Closing script ppas.sh
 
 Since I'm a beginner concerning Pascal and don't know the inner-working
 of the compiler, I ask you for help.
 
Hallo Hans-Peter

1) Do you have the ncurses library installed? (This is quite probable,
   it comes with most distributions) 
   Try: locate libcurses
   or check in /usr/lib, /usr/local/lib for that lib.
   if no luck, install it.

2) It's also possible you don't have the library in the search path,

John

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


Re: [fpc-pascal]Keyboard unit questions

2004-09-11 Thread John Coppens
On Fri, 10 Sep 2004 16:00:34 -0700 (PDT)
Alan Mead [EMAIL PROTECTED] wrote:

 

 John, thanks for your reply... Sorry, I should have been clearer. 
 And I typed wrong.  The library was in /usr/lib but I guess FPC is
 looking for 'libgpm.so' rather than 'libgpm.so.1' .. it's the '.1'
 that fools FPC and it's happened before.  I don't know if it's a
 RedHat thing .. because /usr/lib/libgpm.so.1 is, itself, a sim link
 to something like /usr/lib/libgpm.so.1.18.1.. I gather that's the way
 that one reconciles having the version number in the shared library
 while trying to let linkers find the libraries... I just wonder why
 FPC doesn't understand... Maybe this is considered such a trivial
 matter to people that can write compilers :) Or maybe this is an
 incompatibility between Linux distro's and RH just loses?

If I'm not terribly mistaken, executing ldconfig should generate those
links automatically. libgpm.so.1 should automatically generate a libgpm.so
if you run it (and you should after installing a new library).

That is, of course if /etc/ld.so.conf contains the directory where libgpm
is installed.

an't help you there. 
 
 I've had other programs mis-behave... The command history bits of my
 favorite text adventure game works fine in console mode but screws
 things up when I'm in Konsole.  I spent a little while goggling
 around about keyboards and character sets and X ... but X is probably
 the area of Linux that I know the least and I didn't understand any
 of the stuff I found.
 

As I said - I can't help you there. I've suffered to get fonts working
like I wanted under X. I had quite a few problems getting 'composing'
working on the keyboard (te get accented characters). The only thing I can
recommend is to read the Keyboard-and-Console-HOWTO which is probably
installed somewhere on your machine and is quite extensive.

I have seen that Xterm has its own ways with many things, which could
cause your differences. Almost any other program will act in a more
standard way.

Greetings,
John

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Keyboard unit questions

2004-09-10 Thread John Coppens
On Fri, 10 Sep 2004 08:33:21 -0700 (PDT)
Alan Mead [EMAIL PROTECTED] wrote:

 I just used the keyboard unit for the first time and it's quite
 impressive but I have some questions.
 
 Initially, I couldn't link on my old RH 7.2 machine because FPC 1.9.4
 couldn't find the GPM libraries.  This is probably a stupid question
 but is there a way that FPC can find libraries better so that I don't
 have to ln -s /usr/libgpm.so.1 to /usr/libgpm.so?  This has happened
 with other FPC units...

Hi Alan.

Surely someone with more experience will correct me. But for starters:

libgpm.so.1 shouldn't be in /usr - it should be either in usr/lib or
usr/local/lib. In that case, your machine will automatically do the link,
when it executes ldconfig.

 Anyway, isn't GPM a mouse package?!? I didn't consult the unit's
 source but I don't see any mouse functionality in the docs? Just
 curious.

GPM is a combination of both - it permits using the mouse to 'paint' parts
of text screens and past them as if someone is typing - so it does have
something to mouse _and_ keyboard.

 And finally, I pasted my little example program below.  When I run it
 in Konsole and it has some funny behavior.  Like Shift-F2 is reported
 as F4 and Control-U is reported as 'SHIFT' ^A and ^E don't seem to
 have any text associated with them (maybe it's reporting a space?). 
 I wanted to build a simple bash-like command history/editing and I
 was going to use those but if I cannot read them...

Can't help you there. 

John

 In xterm it's slightly different... for example, ^A does nothing but
 then the next charcter shows as SHIFT x (e.g., ^Aa shows as 'SHIFT
 a') and Shift-F2 shows three keys.. 'Key with scancode 6144', 2, and
 Q while Shift-F3 shows the same scancode and then 2,R.
 
 I tried adding the shift state but that didn't change anything and
 the shift states don't seem to be read accuractely (control and alt
 are never read).
 
 Thanks!
 
 -Alan
 
 program readline;
 
 uses keyboard;
 
   procedure ReadKBD(var S: String);
 var K : TkeyEvent;
 begin
   InitKeyboard;
   Repeat
 K:=GetKeyEvent;
 K:=TranslateKeyEvent(K);
 writeln(KeyEventToString(K));
   Until (GetKeyEventChar(K)='q');
   DoneKeyboard;
 end;
 
 var S:String;
 begin
   ReadKBD(S);
 end.
 
 
 -Alan
 
 ___
 fpc-pascal maillist  -  [EMAIL PROTECTED]
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Programs don't come back

2004-08-04 Thread John Coppens
On Tue, 3 Aug 2004 09:35:14 +0200
Jonas Maebe [EMAIL PROTECTED] wrote:

 
 On 3 aug 2004, at 06:34, John Coppens wrote:
 
  I more or less gave up on using graph - it's a bit of a headache to 
  have
  the video switch modes, particularly while debugging. I don't know if
  there is a more elegant solution, apart from trying to open a new 
  window
  with a gnome-canvas in it or so.
 
 The best solution would be an SDL-based graph unit, I think. Nobody's 
 working on that though, afaik.
 
 
 Jonas

Hi Jonas.

I did a 'client-server' type of thing. On the Pascal-side it looks like a
Graph-compatible library. But instead of switching modes, it starts a new
window, with a gnome-canvas in it. The 'graph' lib then sends its graphic
commands through a pipe to the new window.

It is far from usable (many things are missing) but the idea has several
pluses (in my opinion):

1) The 'remote graph' can be called from other programs as the interface
is just the pipe. I could even be called from bash... (never tried)

2) The gnome canvas has nice anti-aliased graphics, and the resulting
plots _do_ look very nice.

As I said, it is far from complete (eg. no fonts yet) and not very stable
either. One thing I haven't found yet is a way to save the gnome-canvas to
a graphics file (I just made screen shots).

With the experience I had later with gnome-print library, I could image
that this could also be combined somehow.

Is there interest in this?

John
--

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Programs don't come back

2004-08-02 Thread John Coppens
On Mon, 2 Aug 2004 12:40:37 -0700
Jeff Weeks [EMAIL PROTECTED] wrote:

 Fedora core II.  My programs seem to take over the whole screen and 
 when they finish the system is stuck.  Linux doesn't come back.  I have 
 to reboot every time.  There are no loops.. just hitting END..
 
 Any suggestions?
 
 
 ___
 fpc-pascal maillist  -  [EMAIL PROTECTED]
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Tried to press Ctl-Alt-F7 to get back to the X11 window? I've had some old
graphics programs switch to a text terminal window.

John

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]CR / CRLF problem when redirecting to file

2003-09-14 Thread John Coppens
Hello all,

In Linux, when redirecting FPC output to a file, I found that after 25
lines, CR characters are being added, as if in DOS:

program TestCR;
uses
  CRT;
var
  i: integer;
begin
  for i := 1 to 50 do
writeln('The quick brown fox jumps over the lazy dog''s back ', i);
end.

when doing a   ./testcr  testcr.txt

CR's appear on line 25 and after. (This seems to profoundly confuse some
terminal windows, which change mode and have to be 'reset').

John

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]CR / CRLF problem when redirecting to file

2003-09-14 Thread John Coppens
On Mon, 15 Sep 2003 11:26:40 +1000
James Mills [EMAIL PROTECTED] wrote:

 
 In some of my programs I do NOT use the CRT unit but a similar thing
 happens. Go figure :)

Hi James... I didn't have crt in my program, but called another unit that
did have it. So the danger is always present ;-)

Reassigning   assign(f, '');  works for directing to a file, but the
output on the screen doesn't work.

Will have a look at nCRT...

Cheers,
John

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]No source file named ...

2003-09-08 Thread John Coppens
On Mon, 8 Sep 2003 21:05:39 -0300
John Coppens [EMAIL PROTECTED] wrote:

 Hi again
 
 Yet another problem - this one seems more or less erratic, though I
 haven't found a cause yet. Sometimes it works, sometimes not. When in
 gdb, I get:
 
 (gdb) br wav_fmt.pas:330
 No source file named wav_fmt.pas.
 

Solved - It seems that if there is another gdb open, the second session
doesn't work right. I had another gdb open on the same file to be debugged
and forgot about it. On another desktop I called gdb again and got the
described problems.

John

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal