Re: [fpc-pascal] How to contribute code to Free Pascal

2014-06-04 Thread Reinier Olislagers
On 04/06/2014 21:57, md-azbm7jvthboamjb+lgu...@public.gmane.org wrote: > Where would something that is not a specific Pascal source code but a > important reference project actually go? > > The code is not polished, nor can I stop what I am doing right now to > get it polished for the public. But

[fpc-pascal] Problem with StrToCurrDef()

2014-06-04 Thread silvioprog
Hello, I'm trying to convert 'curr > str' and 'str to curr' respectively, but I've got a problem with StrToCurrDef(). See my test below: var s: string; c: Currency; begin c := 150.49; s := CurrToStrF(c, ffCurrency, 2); ShowMessage('OK: ' + s); // shows R$ 150,49 c := StrToCurrDef('R$

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread Jeppe Græsdal Johansen
It will never throw an exception, but it will never be thread safe either. Unless you are using the Interlocked* functions no datatype is threadsafe on a modern processor(except for reference counting of ansistrings, dynamic arrays, and interfaces; and all those use Interlocked* functions unde

[fpc-pascal] How to contribute code to Free Pascal

2014-06-04 Thread m...@rpzdesign.com
Hello: I would like to contribute code to the Free pascal community. Specifically, it is a CodeBlocks C++ project to compile using MinGW C++ compiler to create a static libraries from www.polarssl.org SSL C-code for usage by Lazarus/Freepascal on Windows. It is a little tricky to get all the C c

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
I thought I had publicly declared what I wanted to do. Here is the example code again for ease of reference: Type Class TTest(TObject) public nflag : integer ; sflag : string[30] end; Gui Thread gtest := TTest.Create ; Thread #1 - Constantly changing values while true do begin

[fpc-pascal] error position

2014-06-04 Thread Mattias Gaertner
Hi, When I have an undeclared identifier like begin i :=3; end; fpc 2.6.4 reports: unit1.pas(42,7) Error: Identifier not found "i" Note that it points to the semicolon instead of the i. Is this by design or is it a bug? Mattias ___ fpc-pascal ma

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread Mattias Gaertner
On Wed, 04 Jun 2014 15:03:31 -0400 "Saunders, Rich" wrote: >[...] > Whether static variables are more or less thread safe is for you to > decide since you know what you are doing with them. I don't think either > short strings or Strings are inherently more or less thread safe. It > depends on

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread Ewald
On 04 Jun 2014, at 20:42, m...@rpzdesign.com wrote: > For anybody who has followed this thread, there is some disagreement > over the thread safety of shortstrings. And in this case, a shortstring > with a clearly defined maximum length. > > Some have clearly said string[30] is NOT thread safe.

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread Saunders, Rich
On 2014-06-04 14:42, m...@rpzdesign.com wrote: For anybody who has followed this thread, there is some disagreement over the thread safety of shortstrings. And in this case, a shortstring with a clearly defined maximum length. Some have clearly said string[30] is NOT thread safe. Rich indica

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
For anybody who has followed this thread, there is some disagreement over the thread safety of shortstrings. And in this case, a shortstring with a clearly defined maximum length. Some have clearly said string[30] is NOT thread safe. Rich indicated below he feels they ARE SAFE. Hmmm. Time for

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread Michael Van Canneyt
On Wed, 4 Jun 2014, joha...@nacs.net wrote: On Wed, Jun 04, 2014 at 01:19:33PM -0400, m...@rpzdesign.com wrote: On 6/4/2014 1:16 PM, Michael Van Canneyt wrote: On Wed, 4 Jun 2014, m...@rpzdesign.com wrote: Hello: Is a string[30] declaration under Linux thread safe? No. Michael. Jus

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread johanns
On Wed, Jun 04, 2014 at 01:19:33PM -0400, m...@rpzdesign.com wrote: On 6/4/2014 1:16 PM, Michael Van Canneyt wrote: On Wed, 4 Jun 2014, m...@rpzdesign.com wrote: Hello: Is a string[30] declaration under Linux thread safe? No. Michael. Just as I suspected. So every time a new value is

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread Saunders, Rich
On 2014-06-04 13:22, m...@rpzdesign.com wrote: I guess what I was really asking is: Is there a way to treat an array of chars as a string. I like the string handling patterns of freepascal but I want the memory stability of a static array of chars so I can be used in multi-thread operations wit

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
I guess what I was really asking is: Is there a way to treat an array of chars as a string. I like the string handling patterns of freepascal but I want the memory stability of a static array of chars so I can be used in multi-thread operations without a lot a critical section considerations. Ch

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread Craig Peterson
On 6/4/2014 12:22 PM, m...@rpzdesign.com wrote: > I like the string handling patterns of freepascal but I want > the memory stability of a static array of chars > so I can be used in multi-thread operations without > a lot a critical section considerations. Have you actually verified that adding a

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
Just as I suspected. So every time a new value is assigned to a string[30] variable, memory is allocated and changed by the compiler, so the internal string pointer changes as well. And the only recourse is critical sections for memory access. Correct? CHeers, marco On 6/4/2014 1:16 PM, Mich

Re: [fpc-pascal] Thread Safety of String

2014-06-04 Thread Michael Van Canneyt
On Wed, 4 Jun 2014, m...@rpzdesign.com wrote: Hello: Is a string[30] declaration under Linux thread safe? No. Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Thread Safety of String

2014-06-04 Thread m...@rpzdesign.com
Hello: Is a string[30] declaration under Linux thread safe? I am not worried about atomicity, just that the memory for a string[30] if thread safe. For UTF8String, it is not. I have 2 threads which are comparing/changing memory and I do not want criticalsections wrapping the memory accesses for

Re: [fpc-pascal] Disabling the MIN, MAX, Close icon of EXE in free pascal

2014-06-04 Thread Yann Mérignac
This program works (at least on windows XP) but must be changed according to your language : program consprg; {$mode objfpc}{$H+} uses Classes, Crt, windows; const CloseItemString = '&Fermer'; // '&Fermer' : french // probably '&Close' in englis

Re: [fpc-pascal] Disabling the MIN, MAX, Close icon of EXE in free pascal

2014-06-04 Thread Tomas Hajny
On Tue, June 3, 2014 17:48, Ingmar Tulva wrote: > If you are writing for Windows, you just need to read the documentation > on window style. WS_CAPTION, WS_MINIMIZEBOX and others, I must check the > documentation every time I assign the style flags. See e.g. > http://msdn.microsoft.com/en-us/librar

Re: [fpc-pascal] Disabling the MIN, MAX, Close icon of EXE in free pascal

2014-06-04 Thread Ingmar Tulva
If you are writing for Windows, you just need to read the documentation on window style. WS_CAPTION, WS_MINIMIZEBOX and others, I must check the documentation every time I assign the style flags. See e.g. http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600%28v=vs.85%29.aspx If you