[Lazarus] RealPath function

2009-01-06 Thread Roland Turcan
Hello lazarus project!

I have been using on Kylix function RealPath which comes from libc,
but on freepascal I didn't find the equivalent one.

How can I get the symlinkpath in fpc/lazarus.

Thanks.

-- 
Best regards, TRoland
http://www.rotursoft.sk
http://exekutor.rotursoft.sk

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] RealPath function

2009-01-06 Thread Vincent Snijders
2009/1/6 Roland Turcan k...@rotursoft.sk:
 Hello lazarus project!

 I have been using on Kylix function RealPath which comes from libc,
 but on freepascal I didn't find the equivalent one.

 How can I get the symlinkpath in fpc/lazarus.

 Thanks.


I don't know RealPath, but maybe ReadAllLinks is equivalent:
http://lazarus-ccr.sourceforge.net/docs/lcl/fileutil/readalllinks.html

Vincent
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] File encoding changing silently

2009-01-06 Thread Gabor Boros
Hi,

I am fighting with an ansi/unicode/utf8 problem and during this war 
observed a strange thing for me about file encoding.
When a new project created the encoding is CP1250 (from File 
Setting/Encoding ) for me. Then saved the project the encoding is CP1250 
in File Setting/Encoding. But when reopen the project (with or without 
close Lazarus) Encoding displays UTF8. Is it normal? Lazarus convert 
encoding automatically or new files created with UTF8 but File 
Setting/Encoding display wrong value?

Gabor

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] File encoding changing silently

2009-01-06 Thread Mattias Gärtner
Zitat von Gabor Boros gaborbo...@yahoo.com:

 Hi,

 I am fighting with an ansi/unicode/utf8 problem and during this war
 observed a strange thing for me about file encoding.
 When a new project created the encoding is CP1250 (from File
 Setting/Encoding ) for me.

That's wrong. It should be UTF-8.
(Unless you are using some other templates.)
I fixed one place in r18166. Please test.


 Then saved the project the encoding is CP1250
 in File Setting/Encoding. But when reopen the project (with or without
 close Lazarus) Encoding displays UTF8. Is it normal? Lazarus convert
 encoding automatically or new files created with UTF8 but File
 Setting/Encoding display wrong value?

The IDE guesses the encoding on loading. Normal pascal units contain only ASCII
characters, where CP1250 and UTF-8 are the same.


Mattias

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] File encoding changing silently

2009-01-06 Thread Gabor Boros
I discovered next things. Created new project and encoding is UTF8. It 
is good. But set encoding to CP1250 and go into File Settings/Encoding 
no check appears before any item. But this problem showed only once.
Second problem. The files created with UTF8 now. Right. But if set 
Encoding to CP1250 (after pressed Change file) File Settings/Encoding 
displays good CP1250 value but if reopen the project the File 
Settings/Encoding displays UTF-8 again.

Gabor

Mattias Gärtner írta:
 Zitat von Gabor Boros gaborbo...@yahoo.com:
 
 I fixed one place in r18166. Please test.


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] File encoding changing silently

2009-01-06 Thread Mattias Gärtner
Zitat von Gabor Boros gaborbo...@yahoo.com:

 I discovered next things. Created new project and encoding is UTF8. It
 is good. But set encoding to CP1250 and go into File Settings/Encoding
 no check appears before any item.

Are you sure?
Is there a menu item with a bracket?


 But this problem showed only once.
 Second problem. The files created with UTF8 now. Right. But if set
 Encoding to CP1250 (after pressed Change file) File Settings/Encoding
 displays good CP1250 value but if reopen the project the File
 Settings/Encoding displays UTF-8 again.

Are there any CP1250 characters in the file?
The IDE does not save the information about the encoding. It only saves the text
in the encoding. If the file contains only ASCII characters, then setting CP1250
as encoding has no effect.
You can add {%encoding CP1250} as the first line.

BTW, why do you want to use CP1250 as encoding instead of UTF-8?

Mattias

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Mac/PPC: AUGraphInitialize

2009-01-06 Thread EarMaster - Bent Olsen
Hi all, and a Happy New Year! :-)

We have struggled with a problem on few Mac's with PowerPC's the last couple
of weeks, because we were unable to reproduce the problem on any available
Mac's with PowerPC. The program simply just bounced in the dock and exited
with no errors, crash reports, messages, no nothing.

After sending out test versions with debugging information in log files, we
were able to locate the exact point. The program simply stops running on a
call to AudioToolbox API named AUGraphInitialize.

The initial calls all returned no error status, and AUGraphInitialize
works on most PPC (only 3 reports having this problem) and works on all
i386, with nice and sweet sound.

We have build the code so it checks for status after each API call, and the
initialization should stop if status is anything but OK.

Has anybody else experienced similar problems with AudioToolbox on
PowerPC's? Like different framework versions, etc.?

Btw., except from this problem, we successfully released the Mac PPC/i386
version of the ear training software, EarMaster Pro/School 5 - ported from
Delphi/Win32 and compiled with Lazarus 0.9.27 with FPC 2.2.2, revision 17246
on both PPC and i386 :-)

Best regards,
Normann

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] File encoding changing silently

2009-01-06 Thread Gabor Boros
Mattias Gärtner írta:
 Zitat von Gabor Boros gaborbo...@yahoo.com:
 
 Are you sure?
 Is there a menu item with a bracket?

No. ;-) Before, I said CP1250 but now I say Ansi(cp1250).
When click on Ansi(cp1250) and after go to Encoding again,
Ansi(cp1250) and no other encoding selected.

 BTW, why do you want to use CP1250 as encoding instead of UTF-8?

I don't want. Just playing with encoding setting after you fixed the 
problem.

Gabor

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How can I use TMemDataset

2009-01-06 Thread Joost van der Sluis
Op dinsdag 06-01-2009 om 07:43 uur [tijdzone +0100], schreef Gabor
Boros:
 The result is same with CreateTable and without CreateTable.

I've found the problem and fixed it in trunk. It was again a general
issue, not only for TMemDataset. Thanks for the help.

Joost.

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TFileStream

2009-01-06 Thread Dave Coventry
I've started using TFileStream since posting a query here, but I'd
like to know a bit more about it.

Is there somewhere that I can find information on how to use it?

Specifically, if I load a file into an array as follows:

FS:=TFileStream.Create(fname, fmshareDenyWrite);
FS.ReadBuffer(fsbuffer,recsize);

can I alter the array and then save the altered array back into the file?

do I just write the entire array back?

fsbuffer[128]:=56;
fsbuffer[132]:=42;
FS.WriteBuffer(fsbuffer,recsize);


or is there a better way?
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TFileStream

2009-01-06 Thread Andrew Brunner
You could c write specific calls to write a byte or segment of contiguous bytes.

FS.Seek(128,soFromBegining);
FS.WriteBuffer(fsBuffer[128],1);

FS.Seek(132,soFromBegining);
FS.WriteBuffer(fsBuffer[132],1);



On Tue, Jan 6, 2009 at 7:55 PM, Dave Coventry dgcoven...@gmail.com wrote:
 I've started using TFileStream since posting a query here, but I'd
 like to know a bit more about it.

 Is there somewhere that I can find information on how to use it?

 Specifically, if I load a file into an array as follows:

 FS:=TFileStream.Create(fname, fmshareDenyWrite);
 FS.ReadBuffer(fsbuffer,recsize);

 can I alter the array and then save the altered array back into the file?

 do I just write the entire array back?

 fsbuffer[128]:=56;
 fsbuffer[132]:=42;
 FS.WriteBuffer(fsbuffer,recsize);


 or is there a better way?
 ___
 Lazarus mailing list
 Lazarus@lazarus.freepascal.org
 http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus