[fpc-pascal] Re: fpc-pascal Digest, Vol 95, Issue 21
Bien Miguel, estos son los costos: Ya esta colocado en la WEB 24/05/12Cambio: texto Banner PromocionesS/. 5.00 24/05/12Actualización: Promoiocnes S/. 15.00 *Total * *S/.* *20.00* Att. Luis Del Aguila Telf.: 2422297 Cel.: 999264073 www.aguila3000.net www.conoce3000.com El 10/05/2012 10:04 a.m., fpc-pascal-requ...@lists.freepascal.org escribió: Send fpc-pascal mailing list submissions to fpc-pascal@lists.freepascal.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.freepascal.org/mailman/listinfo/fpc-pascal or, via email, send a message with subject or body 'help' to fpc-pascal-requ...@lists.freepascal.org You can reach the person managing the list at fpc-pascal-ow...@lists.freepascal.org When replying, please edit your Subject line so it is more specific than "Re: Contents of fpc-pascal digest..." Today's Topics: 1. Re: 2.6.0 for Solaris? (microc...@zoho.com) 2. Re: 2.6.0 for Solaris? (microc...@zoho.com) 3. fpc& arm-embedded interrupts (Koenraad Lelong) 4. Re: Re: 2.6.0 for Solaris? (Tomas Hajny) 5. Re: fpc& arm-embedded interrupts (Jeppe Gr?sdal Johansen) 6. Re: Runs correctly when debugging. (Guillermo Mart?nez Jim?nez) 7. Re: 2.6.0 for Solaris? (microc...@zoho.com) 8. Re: Re: 2.6.0 for Solaris? (Tomas Hajny) -- Message: 1 Date: Thu, 10 May 2012 11:22:38 + From: microc...@zoho.com Subject: [fpc-pascal] Re: 2.6.0 for Solaris? To: fpc-pascal@lists.freepascal.org Message-ID:<20120510112300.82330a35...@lists.freepascal.org> Content-Type: text/plain; charset=US-ASCII On Thu, 10 May 2012 07:27:22 + Mark Morgan Lloyd wrote: microcode wrote: What SPARC box(es) do you have? I may be able to host Solaris development systems if needed although the SPARC stuff would have to be scheduled since I cannot leave them on all the time because of the huge noise and heat factor. The Intel box is on most of the time. I've got a range here: mostly U60 running "in anger", a U80, E4500, U10s, a U1, plus some museum pieces I can't find an OS for. I'm also one of very few people who've got an SS1000E running Linux SMP, but that's not a recent distro and because of library versions (**) I'm not sure what if any version of FPC I could get running on it. The E4500s are monsters, aren't they? I'd like to have one but I'm out of space. I'd like an Ultra 80 as well. I could find a spot for one of those. I've got a stack of Sun Fire 210s and 440s. They're very nice but they're in various states of needing odds and ends and I don't have much disk capacity but plenty for development machines. The 210s are two bangers and are fast enough for building large apps in a reasonable timeframe. The 440s are slow but they're unstoppable, they run like a freight train, nothing bothers them. I'm hoping to get a pile of RAM but so far all the promises haven't panned out. I have a bad UPS and when I get that fixed I'll have more machines available to come online whenever needed. ** When a program is built, the (Linux) linker puts the actual filenames of the .so files it expects to find in the binary- not the names of any symlinks. That means that once you've built a binary using standard parameters, that binary /requires/ the same collection of .so versions that was on the development system Right you are. Before reading your post I built glibc-2.14 and tried fp again but no joy.. . ... I managed to get around that to backport FPC from Solaris 10 to 8 but in general I think it's better to start off with a version that runs and work forwards. Agreed. I wholeheartedly agree that power, and in the Summer heat, is a massive problem. There's only so much we can afford, and even with substantial air conditioning things can get pretty unpleasant in my workroom and the adjacent machineroom. That's why I'm only able to offer U10s as always-up systems, Vincent used one of those for Lazarus two or three years ago and I've tried to test both FPC and Lazarus on Linux and Solaris fairly regularly since. Sun makes awfully nice boxes and Solaris is a very nice development platform. I hope the guys will keep FPC going on Solaris. There are many Solaris 10 on Sun fans. I appreciate your offer for packages but since you or somebody else has already pointed me to the buildfaq, I'll try this on my own and when I get stuck I'll email the list again. Thanks again for all the help. You might find it useful to go to the Mantis bug tracker and look at the SPARC-related bugs I've reported- use "View Issues", expand "Search", select "Mark Morgan Lloyd" from "Reporter" then "Use Filter". You might in particular need http://mantis.freepascal.org/view.php?id=18271 when getting your initial FPC binary installed on Solaris 10. Thanks for the info. When you get to compiling, you might find it ne
[fpc-pascal] Re: Fileread function (leledumbo)
El 02/04/2012 05:00 a.m., fpc-pascal-requ...@lists.freepascal.org escribió: Do you mean if FileRead executed when the file pointer is at the end of file, it would wrap around to the beginning? Yes, it is possible? Example, is it correct?: FileWrite(Arch,b,40); // Write 40 bytes FileRead(Arch,b,40); //Read 40 bytes or, is this correct?: FileWrite(Arch,b,40); // Write 40 bytes Fileseek(Arch,0,fsFromBeginning)); //Move to begining FileRead(Arch,b,40); //Read 40 bytes thanks, sorry for my bad english ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Fileread function
Hi, The FileRead function, can move the file pointer at the beginning, when at the end? Thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] random numbers negative
thansk El 16/08/2011 10:36 a.m., Jonas Maebe escribió: On 16 Aug 2011, at 17:25, Luis Fernando Del Aguila Mejía wrote: I have a doubt. With the random function, Can you generate random numbers negative? Begin randomize; Writeln (random (-127)) / / 0> = n> -127 End. random(128)-127; Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] random numbers negative
I have a doubt. With the random function, Can you generate random numbers negative? Begin randomize; Writeln (random (-127)) / / 0> = n> -127 End. thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] fillword with multidimensional dynamic array.
Hello How do I fill a multidimensional dynamic array, with fillWord? Var a:array of array of word; m,n:byte; i,j:byte; Begin m:=3; //array 3 x 3 n:=3; SetLength(a,m,n); for i:=0 to m-1 do //How this block replace con fillword ? for j:=0 to n-1 do a[i,j]:=15; for i:=0 to m-1 do for j:=0 to n-1 do Writeln('a[',i,',',j,'] : ',a[i,j]); End. With manual dynamic array did this: Var a:^word; m,n:byte; i,j:byte; Begin m:=3; //array 3 x 3 n:=3; getmem(a,m*n*2); // word = 2 bytes fillword(a^,m*n,15); for i:=0 to m-1 do for j:=0 to n-1 do Writeln('a[',i,',',j,'] : ',a[i*m+j]); freemem(a) End. thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] getmem
Thanks. El 26/05/2011 06:15 a.m., Felipe Monteiro de Carvalho escribió: On Wed, May 25, 2011 at 7:58 PM, Luis Fernando Del Aguila Mejía wrote: a: = $ ABFE5689 / / Little endian $ 8956FEAB, it is ok Writeln (Hi (a)) / / Show $ ABFE, it is ok Writeln (Lo (a)) / / Show $ 5689, it is ok In a Big Endian computer. What shows Hi and Lo? They show same. Language constructs and RTL routines are Endian-safe ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FillWord with dynamics array.
Thanks. Gracias. El 26/05/2011 05:01 p.m., Jonas Maebe escribió: On 26 May 2011, at 23:18, Luis Fernando Del Aguila Mejía wrote: How fill of the same value a dynamic array? {$codepage utf8} Var A,B:array of word; i:integer; Begin SetLength(A,10); SetLength(B,10); FillWord(A[0],2*10,0); //when value diferent to zero, no runtime error FillWord fills per word (= 16 bit). So you are filling 2*10 = 20 words, while you only allocated 10. Use fillchar if you want to specify the number of bytes. Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] FillWord with dynamics array.
How fill of the same value a dynamic array? {$codepage utf8} Var A,B:array of word; i:integer; Begin SetLength(A,10); SetLength(B,10); FillWord(A[0],2*10,0); //when value diferent to zero, no runtime error FillWord(B[0],2*10,0); for i:=0 to 9 do Writeln(i,A[i]:3,B[i]:3); End. thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] getmem
El 26/05/2011 06:15 a.m., Felipe Monteiro de Carvalho escribió: thanks On Wed, May 25, 2011 at 7:58 PM, Luis Fernando Del Aguila Mejía wrote: a: = $ ABFE5689 / / Little endian $ 8956FEAB, it is ok Writeln (Hi (a)) / / Show $ ABFE, it is ok Writeln (Lo (a)) / / Show $ 5689, it is ok In a Big Endian computer. What shows Hi and Lo? They show same. Language constructs and RTL routines are Endian-safe ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] getmem
El 25/05/2011 01:35 a.m., fpc-pascal-requ...@lists.freepascal.org escribió: Question out of curiosity: Is there a reason why you allocate an array "by hand"? Yes, getmem return NIL, when no more memory is available. SetLength, no return NIL, It is work with Exceptions. My intention was whether it could be done without using dynamic arrays and Exceptions. But two more questions: 1) At this program: Var A:Ansistring; Begin A:='Hi'; End. The literal String is at Data area. Is the A variable points to Data Segment. ? 2) My computer is little endian. (intel) When I do this: a: = $ ABFE5689 / / Little endian $ 8956FEAB, it is ok Writeln (Hi (a)) / / Show $ ABFE, it is ok Writeln (Lo (a)) / / Show $ 5689, it is ok In a Big Endian computer. What shows Hi and Lo? thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: fpc-pascal Digest, Vol 83, Issue 52
El 25/05/2011 01:35 a.m., fpc-pascal-requ...@lists.freepascal.org escribió: Question out of curiosity: Is there a reason why you allocate an array "by hand"? Yes, getmem return NIL, when no more memory is available. SetLength, no return NIL, It is work with Exceptions. My intention was whether it could be done without using dynamic arrays and Exceptions. But two more questions: 1) At this program: Var A:Ansistring; Begin A:='Hi'; End. The literal String is at Data area. Is the A variable points to Data Segment. ? 2) My computer is little endian. (intel) When I do this: a: = $ ABFE5689 / / Little endian $ 8956FEAB, it is ok Writeln (Hi (a)) / / Show $ ABFE, it is ok Writeln (Lo (a)) / / Show $ 5689, it is ok In a Big Endian computer. What shows Hi and Lo? thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] getmem
I'm surprised this compiles at all. Ok, Does my program does not compile on your computer ? You're mixing up manual allocation of memory on the heap for variables such as arrays with compiler allocation of heap memory for ansistrings (which are reference counted and deallocated automatically). Yes something like that. I'm trying to emulate something like this: VarLCad = array[0..2] of ansistring; Begin LCad[0]:='01234'; LCad[1]:='56789'; LCad[2]:='1'; Writeln(LCad[2]); End. But using GetMem(LCad,4*3) for the array. (4 bytes for the ansistring pointer). This can be done with: TList. But I write these simple programs, to know how compiler works. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] getmem
I know that you can use dynamic arrays (array of). Is better. But this does not understand and confuse me. Why to create an array of 3 elements (ANSIString) with GetMem, I have to put a size of 15 bytes (5*3) and not 12 bytes (4*3).? The program works with 15 bytes, but do not understand why not work with 12 bytes. Thanks. {$codepage utf8} Var LCad:^ansiString; Begin getmem(LCad,5*3); //ansistring is a pointer 4 bytes LCad[0]:='01234'; LCad[1]:='56789'; LCad[2]:='1'; Writeln(LCad[2]); freemem(LCad) End. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: PChar resize (Anton Shepelev)
Thanks Mattias and Anton. Ie: When you assign a constant string to a PChar then assigns the address of the string constant. I believed that be created a PChar in the heap. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] PChar resize
Hi, I have two questions about PChar. Why Reallocmem function does not work with PChar? How to increase the size of PChar without using Strings unit? Thanks. {$codepage utf8} Var a:Pchar; i:byte; Begin ReturnNilIfGrowHeapFails:=true; a:='x'; for i:=0 to 9 do Writeln('[',i,']',a[i]); Writeln('---'); Reallocmem(a,20); //ko End.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] AnsiString setlength and getmem.
(* Program One *) {$codepage utf8} {$Mode objfpc} Uses math,sysutils; Var cad:ansistring; c,n:longword; Begin c:=2**30; // 1 GiB n:=4; // with 3 & 4 at fpc 2.4.2, no show Out of Memory // with 3 & 4 at fpc 2.5.1, no show Out of Memory (02/11/2011 04:04p.m. snapshot) try setlength(cad,(c*n)-1); Writeln('ok') Except On EOutOfMemory do Writeln('Out of Memory, free more memory'); End; End. (* Program Two *) {$codepage utf8} {$Mode objfpc} Uses math,sysutils; Var p:^byte; c,n:longword; //2**32 Begin c:=2**30; // 1 GiB n:=4;// with 4 fail at fpc 2.4.2, no Show Out of Memory, but // at fpc 2.5.1, no Show Out of Memory, show EInvalidPointer (02/11/2011 04:04p.m. snapshot) try getmem(p,(c*n)-1); //Si n es 5 entonces se trunca y lo crea longword((c*n)-1) Writeln('ok') Except On EOutOfMemory do Writeln('Out of Memory, free more memory'); On EInvalidPointer do Writeln('Invalid Pointer'); End; End. I'm not sure if they are mistakes. I know very well the work exceptions. Program One: Why not show Out of Memory? Program Two: What should show Out of Memory or Invalid Pointer? Thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: AnsiString (Luis Fernando Del Aguila Mej?a) (Jonas Maebe)
My intention is not to write code that will go wrong at some point. My intention is to understand the inner workings of the compiler, apparently did not explain me well. Let me explain: If I use a function that should always return 5, and for unknown reasons returns 8. I wonder because it failed and so help with a solution. Anyway, if you do not understand me, I will need repeat my studies of English, or no longer use google translator. :) Do not worry I understand, what I say. Thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: AnsiString (Luis Fernando Del Aguila Mej?a)
Thanks for the tip, David. My intention is to learn or acquire knowledge. True the function Length is easier to use, but it's always good to know the internals of the compiler. You never know when something may go wrong. Thanks - Original Message - From: To: Sent: Wednesday, January 26, 2011 6:00 AM Subject: fpc-pascal Digest, Vol 79, Issue 46 Send fpc-pascal mailing list submissions to fpc-pascal@lists.freepascal.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.freepascal.org/mailman/listinfo/fpc-pascal or, via email, send a message with subject or body 'help' to fpc-pascal-requ...@lists.freepascal.org You can reach the person managing the list at fpc-pascal-ow...@lists.freepascal.org When replying, please edit your Subject line so it is more specific than "Re: Contents of fpc-pascal digest..." Today's Topics: 1. AnsiString (Luis Fernando Del Aguila Mej?a) 2. Re: AnsiString (David Emerson) 3. Re: AnsiString (J?rgen Hestermann) 4. linking error while cross compiling win64 -> Linux64 (Julien Devillers) 5. compiling 2.4.2 under 7-64 (Julien Devillers) 6. Re: compiling 2.4.2 under 7-64 (Marco van de Voort) -- Message: 1 Date: Tue, 25 Jan 2011 10:13:13 -0500 From: Luis Fernando Del Aguila Mej?a Subject: [fpc-pascal] AnsiString To: Message-ID: Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original The documentation (http://www.freepascal.org/docs-html/prog/progsu146.html#x189-1990008.2.7) says: -8 Longint current string with size. -4 Longint with reference count. But, when I want access to that structure, I have to do it backwards. -8 Longint with reference count. -4 Longint current string with size. {$codepage UTF8} Var cad1:AnsiString; aux1:AnsiString; p:pointer; Begin SetLength(cad1,8); p:=pointer(cad1); Writeln('memory address : ',longint(p)); p:=p-4; Write('memory address : ',longint(p),'='); //Must show reference count, but shows size Writeln(longint(p^)); aux1:=cad1; p:=pointer(cad1); p:=p-8; Write('memory address : ',longint(p),'='); //Must show Size, but shows reference count Writeln(longint(p^)); End. Do these positions are different, depending on microprocessor being used ? Thanks -- Message: 2 Date: Tue, 25 Jan 2011 11:23:36 -0800 From: David Emerson Subject: Re: [fpc-pascal] AnsiString To: FPC-Pascal users discussions Message-ID: <201101251123.36365.dle...@angelbase.com> Content-Type: text/plain; charset="utf-8" Luis Fernando Del Aguila Mejía wrote: The documentation (http://www.freepascal.org/docs-html/prog/progsu146.html#x189-1990008.2.7) says: -8 Longint current string with size. -4 Longint with reference count. But, when I want access to that structure, I have to do it backwards. -8 Longint with reference count. -4 Longint current string with size. Do these positions are different, depending on microprocessor being used ? I'm fairly certain that is an error in the documentation, and that it SHOULD always be as you discovered it to actually be. As an aside, a tip for doing pointer arithmetic... var s : ansistring; p : ptruint; p := pointer(s); dec(p); // equivalent to p:=p-4 because p is a typed pointer. Using typed pointers in this way will likely make it easier to adapt your code to a 64-bit conversion in the future. Also note that, in this case, dec(p,2) would do p:=p-8, as (hopefully) expected I use these types of constructs frequently, and it makes it much easier to change types, if that is ever necessary, or adapt constructs to new types. Cheers, David -- Message: 3 Date: Wed, 26 Jan 2011 07:50:01 +0100 From: J?rgen Hestermann Subject: Re: [fpc-pascal] AnsiString To: FPC-Pascal users discussions Message-ID: <4d3fc419.7070...@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Luis Fernando Del Aguila Mejía schrieb: > p:=pointer(cad1); > p:=p-8; > Write('memory address : ',longint(p),'='); //Must show Size, but shows reference count > Writeln(longint(p^)); I fail to see why you need to mess with the internals of ansistrings at all. What is the reason to access size and reference count this way? At least for the size there is Length(cad1) which would be much clearer. Although pointer arithmetic is possible in Pascal it looks like C. And you loose any help from the compiler to check types. -- Message: 4 Date: Tue, 25 Jan 2011 17:19:42 +0100 From: "Julien Devillers" Subject: [fpc-pascal] linking error while cross compiling win64 -> Linux64 To: Message-ID: Content-Type: text/plain; charset="iso-8859-1" Hi = I have a linking error with the following comp
[fpc-pascal] AnsiString
The documentation (http://www.freepascal.org/docs-html/prog/progsu146.html#x189-1990008.2.7) says: -8 Longint current string with size. -4 Longint with reference count. But, when I want access to that structure, I have to do it backwards. -8 Longint with reference count. -4 Longint current string with size. {$codepage UTF8} Var cad1:AnsiString; aux1:AnsiString; p:pointer; Begin SetLength(cad1,8); p:=pointer(cad1); Writeln('memory address : ',longint(p)); p:=p-4; Write('memory address : ',longint(p),'='); //Must show reference count, but shows size Writeln(longint(p^)); aux1:=cad1; p:=pointer(cad1); p:=p-8; Write('memory address : ',longint(p),'='); //Must show Size, but shows reference count Writeln(longint(p^)); End. Do these positions are different, depending on microprocessor being used ? Thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: Data alignment of records
Maybe a better question is: why do you want to know the alignment of different data types? Since it can change depending on which platform you are compiling for, writing your code assuming a particular alignment is generally a very bad idea. Not only want to know the alignment of different data types, there are also other things, the reasons are: 1. Because I want to learn and understand how the compiler works. 2. If I find a mistake, I would like to know how to fix it thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: Data alignment of records
Maybe a better question is: why do you want to know the alignment of different data types? Since it can change depending on which platform you are compiling for, writing your code assuming a particular alignment is generally a very bad idea. Not only want to know the alignment of different data types, there are also other things, the reasons are: 1. Because I want to learn and understand how the compiler works. 2. If I find a mistake, I would like to know how to fix it thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: Data alignment of records
I don't know what you mean by "registration data". Sorry. Can someone explain to me, about the Data alignment of records and other variables. thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Data alignment of records
I can not understand the data alignment of records. I compiled the program PackRecordsDemo, http://www.freepascal.org/docs-html/ref/refsu16.html#x40-470003.3.2 sample documentation. But the result on my computer is different: Size Trec1 : 4 Offset B : 2 Size Trec2 : 3 Offset B : 1 Size Trec3 : 2 Offset B : 1 Size Trec4 : 2 Offset B : 1 Size Trec5 : 5 Offset B : 1 Offset C : 4 //diferent Size Trec6 : 5 Offset B : 1 Offset C : 4 //diferent Size Trec7 : 9 Offset B : 1 Offset C : 8 //diferent Size Trec8 : 9 Offset B : 1 Offset C : 8 //diferent Can someone explain to me, about the alignment of registration data and other variables. My computer is : intel Quad CPU Q6600 S.O. Windows Vista Att. Luis Del Aguila ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] How I can associate a text file name in UTF8?
How I can associate a text file name in UTF8? Example: Assign (F, 'タスク 01.txt'); Assign (F, 'Задание 01.txt'); Assign (F, '♕ Queen.txt'); thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Fw: Question mark?
ok, I understand. Excuse my ignorance. But what is mantis? What routines of the Windows API, use the Widestring Manager in Windows? Is there a guide to understanding the source of FPC? Thank you. Danke. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: fpc-pascal Digest, Vol 75, Issue 19
Ok, I understand. So readln is affected by the WideString Manager, and the WideString Manager use operating system routines, (Windows). In linux I use cwstring. ok. In this case, When I use readln. readln (cad); The command interpreter uses 850 (cmd), but Windows uses 1252. When I enter the symbol €, it converts it to ?. As I understand, because this symbol does not exist in 850. But when I use Writeln ('€'), no shows the question mark ?. As I understand, it is because the symbol exists in 1252. That is, When I use readln, then the Widestring manager use the charset of the command interpreter (cmd 850), and when I use writeln, then the Widestring manager, use the charset of the Operating System (ANSI-1252). (only windows) Am I right, or am I wrong? thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Question mark?
ok, thanks for your response. But I believed that the Widestring manager, are routines that are included in the compiled program. But you mention that there is an "OS widestring manager". I'm confused, how many widestring manager exist?. For example, when I write this statement: Writeln ('привет'); / / Hello in Russian The widestring manager, convert the string to six question marks. its ok. But, What Widestring manager, makes the task?. Thank you.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Question mark?
In the following program: {$ Codepage UTF8} var str: string; Begin Readln (str); Writeln (str) End. When I enter the following: €uro, shows me: ?uro. The console uses 850 and S.O. 1252, for non-Unicode programs. My question is: Who puts the question mark? The widestring manager or my console. thank you___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] questions mark linux and windows
I understand what you say. But to know the current charset in Windows, what function uses the compiler?: a) getOEMCP b) getACP c) Other thanks. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] questions mark linux and windows
I wrote this program. var c,d: char; Begin c:=#$00B1; Writeln(byte(c)); Writeln(c); d:=#$0080; Writeln(byte(d)); Writeln(d); End. When I compile on Linux, the variable "c" stores the value #$B1, and the variable "d" stores the value #$80. But when I compile the program in Windows, "c" storage #$B1, and "d" store #$3F. In windows, puts a question mark for the range : #$0080 to #$009F. My questions is : Why put the second byte in Linux and Windows puts a question mark? P.D. The source code is at Win-1252 Thanks. Luis Del Aguila ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] UTF8Decode
Ok, thanks. But I'm writing a book about FreePascal in Spanish (http://www.conoce3000.com/html/espaniol/Libros/PascalConFreePascal/Indice.html). And I do not want to write something to discourage the use of the compiler. I apologize if my questions are a bit uncomfortable. Why WideString is not equal to Unicodestring in Windows? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] UTF8Decode
When compiling this program http://www.conoce3000.com/Test.pp in Windows receive the following error: Test.pp(4,11) Error: Can't determine which overloaded function to call The problem only happens when I use a utf8 character. What am I doing wrong? In Linux, the program compile OK. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Two questions Widechar
For this program : http://www.conoce3000.com/prueba.pp Why not show the Euro?. The shell is in Win-1252 and the source code on Win-1252 Does WideChar only used with Unicode BMP Plane 0 ó UCS-4? thanks.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: source code UTF8 with BOM problems ?
what platform do you develop, what are your target platforms? English: Most commonly, Linux and Windows, both 32 bits. I want to use Unicode-UTF8 with linux and want to use Win-1252 with Windows. My question is: Is my decision right? Spanish : Lo más común, linux y windows, ambos 32 bits. Deseo usar Unicode-UTF8 con linux y deseo usar Win-1252 con Windows. Mi pregunta es : ¿Es adecuada mi decisión? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: source code UTF8 with BOM problems ?
Another question. For write programs in console or mode text. For the source code. What charsets is appropriate to use with Free Pascal? a) ASCII (7 bits) b) iso-8859-1 c) Windows-1252 d) IBM 850 e) Unicode-UTF8 if your answer is (a), then : What disadvantages does use the Unicode-UTF8? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: source code UTF8 with BOM problems ?
Thanks, that works. but, What is a widestring manager? Att. Luis Del Aguila ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] source code UTF8 with BOM problems ?
Hello, the problem is only linux. The following source code uses UTF8 without BOM, http://www.conoce3000.com/Ejemplo01.pp the compiler compiles ok and the program displays the message in Unicode UTF8 ok The following source code uses UTF8 with BOM http://www.conoce3000.com/Ejemplo02.pp the compiler compiles ok and the program displays the message in Unicode UTF8 with question marks. How can I tell the compiler to ignore the BOM? Thanks ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: Ido not understand UTF8 in Windows
Ok, The steps are : 1) Change the Font Type at Lucida Console Font : http://www.conoce3000.com/fig01.jpg 2) Compile the program with fpc 2.4. : 3) change to UTF8, with chcp 65001 command 4) run the program Step 01 to 04 : http://www.conoce3000.com/fig02.jpg The source code : http://www.conoce3000.com/Prueba005.pp The error ocurred only when use Lucida console Font. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: Ido not understand UTF8 in Windows console.
If you are doing this in Lazarus by default you are creating a GUI application, so any writeln will raise an error as stdout is closed. I am not using lazarus, I am using PSPad, gedit, jedit, notepad, etc.. I just wanted to know is whether you can write the source code using UTF8. In linux this simple program, it compiles and runs, but in windows vista bussines is not possible. The problem appears only when using UTF8 own characters, like accented "o". Example: "camión", with accent at failure, but "camion" without an accent, not the failure occurs ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Ido not understand UTF8 in Windows console.
Translate Message : English Ido not understand UTF8 in Windows console. I wrote the following program, using an editor UTF8 without BOM mark. {código de página UTF8} //sin firma Unicode BOM Begin Writeln('code page UTF8 - 65001 en Windows'); Writeln('camión') End. Using the command chcp, change the code page to 65001, the UTF-8 for Windows. I compiled the program, and then run and get the following errror: Runtime error 101 at $00401460 $00401460 $004069B1 The same program when compiled and run on linux, no error. works well. What am I doing wrong? Original Message Spanish: No entiendo UTF8 en consola Windows Yo escribí el siguiente programa, usando un editor UTF8, sin marca de BOM. Usando el comando chcp, cambio el código de página a 65001, el UTF8 para Windows. Compilo el programa, y después lo ejecuto y aparece el siguiente error : El mismo programa, cuando lo compilo y lo ejecuto en linux, no aparece ningún error. funciona bien. ¿Qué estoy haciendo mal? ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal