Re: [fpc-pascal] an old Turbo-Pascal source

2007-01-03 Thread Daniël Mantione


Op Wed, 3 Jan 2007, schreef Friedrich Hattendorf:

> using among others 
> 
>  - ^Screen  (from unit Dos)
>  - unit GRAPH
> 
> (I think, we then had written it with TP4)
> 
> is there any chance to compile the source with FreePascal?

It depends on the amount of assembler in it. If it is pure Pascal, there 
is a very good chance. Some minor modification might be necessary.

> Where may I find the information, how to convert?

http://www.freepascal.org/port.var

... and the official manuals.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] an old Turbo-Pascal source

2007-01-03 Thread Marco van de Voort
> using among others 
> 
>  - ^Screen  (from unit Dos)

This indicates direct access of the textmode screen, which is not a good
sign?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] an old Turbo-Pascal source

2007-01-03 Thread Florian Klaempfl

Marco van de Voort schrieb:
using among others 


 - ^Screen  (from unit Dos)


This indicates direct access of the textmode screen, which is not a good
sign?


This works on go32v2?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] FileExists inconsistency

2007-01-03 Thread Henry Vermaak

Hi all

FileExists seems to be inconsistent between linux and windows.
FileExists in linux returns true for a directory, but not in windows.
The windows behaviour is consistent with Delphi, though, and I assume
that's correct.

Can anyone confirm or comment on this?

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


Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Vincent Snijders

Henry Vermaak schreef:

Hi all

FileExists seems to be inconsistent between linux and windows.
FileExists in linux returns true for a directory, but not in windows.
The windows behaviour is consistent with Delphi, though, and I assume
that's correct.

Can anyone confirm or comment on this?



I can confirm this.

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


Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Daniël Mantione


Op Wed, 3 Jan 2007, schreef Vincent Snijders:

> Henry Vermaak schreef:
> > Hi all
> > 
> > FileExists seems to be inconsistent between linux and windows.
> > FileExists in linux returns true for a directory, but not in windows.
> > The windows behaviour is consistent with Delphi, though, and I assume
> > that's correct.
> > 
> > Can anyone confirm or comment on this?
> > 
> 
> I can confirm this.

There is no getting away that Dos filesystem handling is different 
from Unix file handling. On Dos like platforms, a filename with 
a same name as a subdirectory can exist in the same directory. In other 
words, it should return false.

On the other hand, in Unix, it should return true because otherwise code 
like:

if not fileexists('abcd') then
  begin
assign(f,'abcd');
rewrite(f);
  end;

... becomes unreliable.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Henry Vermaak

There is no getting away that Dos filesystem handling is different
from Unix file handling. On Dos like platforms, a filename with
a same name as a subdirectory can exist in the same directory. In other
words, it should return false.



I cannot create a file with the same name as a subdir under Windows XP
on ntfs or fat32...


On the other hand, in Unix, it should return true because otherwise code
like:

if not fileexists('abcd') then
  begin
assign(f,'abcd');
rewrite(f);
  end;

... becomes unreliable.



...so that means that this code will also be unreliable on windows.
In short: the 2 file systems are consistent with their behaviour in
this respect, but the FileExists is not.

Maybe there's something I'm missing?

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


Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Daniël Mantione


Op Wed, 3 Jan 2007, schreef Henry Vermaak:

> > There is no getting away that Dos filesystem handling is different
> > from Unix file handling. On Dos like platforms, a filename with
> > a same name as a subdirectory can exist in the same directory. In other
> > words, it should return false.
> > 
> 
> I cannot create a file with the same name as a subdir under Windows XP
> on ntfs or fat32...
> 
> > On the other hand, in Unix, it should return true because otherwise code
> > like:
> > 
> > if not fileexists('abcd') then
> > begin
> > assign(f,'abcd');
> > rewrite(f);
> > end;
> > 
> > ... becomes unreliable.
> > 
> 
> ...so that means that this code will also be unreliable on windows.
> In short: the 2 file systems are consistent with their behaviour in
> this respect, but the FileExists is not.
> 
> Maybe there's something I'm missing?

No, because in a Dos like filesystem, a direcory abcd will still allow a 
file abcd to be created. In other words, fileexists returns false so the 
file can be created.

In a Unix like filesystem, a directory abcd will prevent a file abcd to be 
created, so fileexists returns true.

In short, in Dos filesystems, directories are not considered files. In 
Unix filesystems they are considered files.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Marco van de Voort
> Maybe there's something I'm missing?

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


Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Jonas Maebe


On 3 jan 2007, at 16:46, Daniël Mantione wrote:


Op Wed, 3 Jan 2007, schreef Henry Vermaak:


There is no getting away that Dos filesystem handling is different
from Unix file handling. On Dos like platforms, a filename with
a same name as a subdirectory can exist in the same directory. In  
other

words, it should return false.



I cannot create a file with the same name as a subdir under  
Windows XP

on ntfs or fat32...


[snip]


Maybe there's something I'm missing?


No, because in a Dos like filesystem, a direcory abcd will still  
allow a
file abcd to be created. In other words, fileexists returns false  
so the

file can be created.


As he mentioned above, that does not work for him. It also does not  
work for me in MS Dos 6.22 and fat16 (running in an emulator, but I  
doubt that changes anything for this sort of stuff):






Jonas


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

Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Henry Vermaak


DirectoryExists?


Yes, I know about that.  Looks like you have to use FileExists and
DirectoryExists together.

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


Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Daniël Mantione


Op Wed, 3 Jan 2007, schreef Jonas Maebe:

> > > Maybe there's something I'm missing?
> > 
> > No, because in a Dos like filesystem, a direcory abcd will still allow a
> > file abcd to be created. In other words, fileexists returns false so the
> > file can be created.
> 
> As he mentioned above, that does not work for him. It also does not work for
> me in MS Dos 6.22 and fat16 (running in an emulator, but I doubt that changes
> anything for this sort of stuff):

Whoops, I overlooked that part of his answer. You're right, I cannot 
either (PC-Dos 2000, no emulation). This is weird, because I have been 
able to do this in the past. But it has then been changed a long time ago 
already.

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] an old Turbo-Pascal source

2007-01-03 Thread Jason P Sage
Regarding porting the .^Screen references, if you know the format of how
screen memory works.. you can allocate your own memory block and treat it
like the screen and then make (usually need two) routines to move that data
to the screen via a more FreePascal friendly method.

I say two routines - because I've done this kind of programming using
another language call Synergy DiBoL as well as with FreePascal using the
"video" unit. Which BTW is fairly portable to my knowledge. 

The first main ROUTINE for moving the "screen mem data" through the video
unit does a complete screen draw. 

The other is kind of a dual purpose routine that allows writing to both
simultaneously - that is - in mine I would have a basic call that allowed me
to write a char to a specific cell on the screen and it would actually
modify my own "screen" mem as well as use the video unit. This way a
complete redraw still works.

Now admittedly - you will probably end up doing a lot of variations for this
single char "core" routine - like to only change foreground color in a cell,
or only background color - and maybe do advanced stuff like handle the
blinky cursor thing, and allow writing entire strings etc.

I have an old lib online called SageAPI3 or something - but its for
freepascal 1.0.9 I think or something and I have newer 2.0.x code available
here: http://www.jegas.org/?PAGE=main&SECTION=download

Its not documented - and is only a subset of what I'm working on but there
is some neat code in there that might help ya.

Best Regards,

Jason P Sage
[EMAIL PROTECTED]
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.3/614 - Release Date: 1/2/2007
2:58 PM
 

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


Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Jason P Sage
I've written stuff in freepascal that can load and parse a directory and
decipher if it’s a directory or a file - even on POSIX (linux - Fedora 5).

I'm not saying this is a big achievement - but perhaps - at an expense of
speed - but in definitive returned results - I wonder if it would be prudent
to add a filexists routine or make the current one - do this type of
"thorugh checks".

I am aware of running to issue though with permissions - but these usually
make sense. If the file doesn't exist - but does - you don't have write
permissions.

I made a routine that goes through a couple steps - (probably the wrong way
but is portable) to both READ ONLY and READ WRITE (no actual writing) the
file just to see if I have read access and alternatively read/write.

This is great because if I need to verify a configuration file exists - I do
not necessarily need write permission ... and sometimes you do. Having a
little more info allows one to make more detailed error log files - and user
interface "messages" so users and administrators - heck - us
heads-down-coders can figure out what and why quickly when something doesn't
go as planned.
 
Best Regards,

Jason P Sage
[EMAIL PROTECTED]


http://www.jegas.com


 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.3/614 - Release Date: 1/2/2007
2:58 PM
 

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


Re: [fpc-pascal] FileExists inconsistency

2007-01-03 Thread Marco van de Voort
> 
> Whoops, I overlooked that part of his answer. You're right, I cannot 
> either (PC-Dos 2000, no emulation). This is weird, because I have been 
> able to do this in the past. But it has then been changed a long time ago 
> already

Afaik some of the FS Dos habits changed going from FCBS to handle based
programming. This could be one of them.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FreeType 2 with Free Pascal

2007-01-03 Thread Krishna

Hi Graeme,

On 12/29/06, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote:

Hi,

Has anybody ever used the FreeType 2 library directly with Free
Pascal? Anybody know of converted C headers for FreeType 2?

I want to implement anti-aliased text in my fpGUI widget set and
started with Xft, but that only works under Linux and not Windows. Not
really a issue I guess, I just heard that FreeType 2 apparently
generates even better glyphs under Windows than Windows inself can.
Also FreeType 2 is self contained, so the requirements would be even
less if I use it compared to Xft.



Have you considered AggPas? It is a native object pascal port of the
Antigrain Geometry library. It sure looks cool! Check it out here:
http://aggpas.org .

Cheers,
Krishna
--
I long to accomplish a great and noble task, but it is my chief duty
to accomplish small tasks as if they were great and noble !
- Helen Keller
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal