Re: [Harbour] safe clear of variable content

2010-01-13 Thread Przemysław Czerpak
On Wed, 13 Jan 2010, Szak�ts Viktor wrote: > > But if pw exists in a single instance, isn't it a waste to create a new item > > to store a string of the same lenght? > Yes, speaking about STUFF(), it is, but to avoid it, > you'd have to make several checks to verify whether > there is room to opt

Re: [Harbour] safe clear of variable content

2010-01-13 Thread Viktor Szakáts
>> These were my two first thoughts, but internally >> I think they both just create new string and may >> leave old buffer content around in an unreleased >> block. >> > > But if pw exists in a single instance, isn't it a waste to create a new item > to store a string of the same lenght? Yes

Re: [Harbour] safe clear of variable content

2010-01-13 Thread Przemysław Czerpak
On Wed, 13 Jan 2010, Szak�ts Viktor wrote: > Thank you. Just posted pretty much the exact same solution :) I've seen and you even used exactly the same name as I in 1-st version :) by then I decided that setting spaces may be more functional for users also in some other context, i.e. clearing get

Re: [Harbour] safe clear of variable content

2010-01-13 Thread Maurilio Longo
Viktor, > > These were my two first thoughts, but internally > I think they both just create new string and may > leave old buffer content around in an unreleased > block. > But if pw exists in a single instance, isn't it a waste to create a new item to store a string of the same lenght? Ma

Re: [Harbour] safe clear of variable content

2010-01-13 Thread Viktor Szakáts
> Indirectly by functions using hb_itemGetWriteCL() on parameters passed > by reference. You can find few functions in HBRTL. > >> --- server.prg >> ? "Please enter password:" >> ACCEPT TO pw >> >> pw := NIL >> >> --- >> I want that the content of 'pw' variable be surely >> cleared from memory.

Re: [Harbour] safe clear of variable content

2010-01-13 Thread Viktor Szakáts
Hi Maurilio, > Viktor, > > pw := Space( Len( pw ) ) > > could do it? > > And a > > pw := Stuff( pw, 1, Len( pw ), Space( Len( pw ) ) ) > > Given that the string has same lenght shouldn't it reuse allocated memory? These were my two first thoughts, but internally I think they both just creat

Re: [Harbour] safe clear of variable content

2010-01-13 Thread Przemysław Czerpak
On Wed, 13 Jan 2010, Szak�ts Viktor wrote: Hi, > Is there a safe way to clear to content of a variable in Harbour? Indirectly by functions using hb_itemGetWriteCL() on parameters passed by reference. You can find few functions in HBRTL. > --- server.prg > ? "Please enter password:" > ACCEPT TO

Re: [Harbour] safe clear of variable content

2010-01-13 Thread Maurilio Longo
Viktor, pw := Space( Len( pw ) ) could do it? And a pw := Stuff( pw, 1, Len( pw ), Space( Len( pw ) ) ) Given that the string has same lenght shouldn't it reuse allocated memory? Maurilio. Viktor Szakáts wrote: > Hi All, > > Is there a safe way to clear to content of a variable in Harbour?

[Harbour] safe clear of variable content

2010-01-13 Thread Viktor Szakáts
Hi All, Is there a safe way to clear to content of a variable in Harbour? --- server.prg ? "Please enter password:" ACCEPT TO pw pw := NIL --- I want that the content of 'pw' variable be surely cleared from memory. Is this currently possible? and how? Brgds, Viktor