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

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.

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 english

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

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,

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.

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

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 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.

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 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

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 Mattias Gaertner
On Wed, 04 Jun 2014 15:03:31 -0400 Saunders, Rich greym...@mykolab.com 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.

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] 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

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

[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] 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 it