Recent

Author Topic: How to keep data changed in a StringGrid without save to file?  (Read 10631 times)

Huandi

  • Newbie
  • Posts: 5
Re: How to keep data changed in a StringGrid without save to file?
« Reply #15 on: April 27, 2017, 05:40:12 pm »
@molly

For example, ntfs-streams can be used to save unimportant user settings (windows position, size, etc.), saving hash of file, and so on.
« Last Edit: April 27, 2017, 05:42:10 pm by Huandi »

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: How to keep data changed in a StringGrid without save to file?
« Reply #16 on: April 27, 2017, 05:54:39 pm »
@Huandi:

Yes, i am aware. i also use sysinternals toolbox and some other nice tools that are able to show you all ins and outs of f.i. ADS  ;D

Afaik there are quite some restrictions (also from Free Pascal point of view) which would make it cumbersome to work with. Not to mention platform compatibility (or actually filesystem compatibility). They serve their purpose  :)

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Re: How to keep data changed in a StringGrid without save to file?
« Reply #17 on: April 27, 2017, 05:58:38 pm »
The TS doesn't want to save the data to a file. ADS sounds to be the solution. Googling the web, I now know ADS is often ignored even by some of MS products.

It said:
Quote
you should not use alternate streams for storing any critical information.

:'( Sad, knowing that ADS is useless (to me). I mean: when you save something, you really want it safe.

Anyway, I'm still glad I've learned something new today.
« Last Edit: April 27, 2017, 06:01:05 pm by Handoko »

Huandi

  • Newbie
  • Posts: 5
Re: How to keep data changed in a StringGrid without save to file?
« Reply #18 on: April 27, 2017, 06:04:59 pm »
I'll add, ntfs-streams can be made by any folder, including fairly stable system (c:\windows:mydata.lol)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4458
  • I like bugs.
Re: How to keep data changed in a StringGrid without save to file?
« Reply #19 on: April 28, 2017, 05:37:13 pm »
So Juha's answer is really the best one.
Now I realize I may have been influenced by watching interviews of my country-man Kimi Räikkönen.
 https://www.youtube.com/watch?v=kd8ij8l1q8Y
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: How to keep data changed in a StringGrid without save to file?
« Reply #20 on: April 28, 2017, 05:43:18 pm »
And if your exe which tries to write to a ntfs stream for whatever reason once is on a FAT32-formatted usb stick it will not work any more...

What is the problem of not writing to a old-fashioned file? I've always mistrusted software trying to hide something from my eyes.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: How to keep data changed in a StringGrid without save to file?
« Reply #21 on: April 28, 2017, 05:52:13 pm »
Now I realize I may have been influenced by watching interviews of my country-man Kimi Räikkönen.
I thought all Finnish men are like that ... quiet/reserved and to the point ?

What is the problem of not writing to a old-fashioned file? I've always mistrusted software trying to hide something from my eyes.
Use the cloud, luke  :D

But fwiw, i agree.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: How to keep data changed in a StringGrid without save to file?
« Reply #22 on: April 29, 2017, 12:07:48 am »
I want that when I run the program again, the data I typed in the StringGrid still exist without using the procedure LoadFromFile or LoadFromCVSFile etc.
If you are on Windows then use registry, or use components that automatically load and save form properties for you:
http://wiki.lazarus.freepascal.org/TINIPropStorage
http://wiki.lazarus.freepascal.org/TXMLPropStorage
http://forum.lazarus.freepascal.org/index.php?topic=35806.0
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

boren

  • New Member
  • *
  • Posts: 25
Re: How to keep data changed in a StringGrid without save to file?
« Reply #23 on: April 30, 2017, 06:36:14 pm »
I see that using NTFS stream will apply to my purpose; however, it will work with NTFS file system only.
I wonder why other file systems do not have such feature of NTFS file system.
Thanks so much!
Boren.

 

TinyPortal © 2005-2018