Page 1 of 1
how to store more than 1 results for later reuse?
Posted: 02 Apr 2011 17:37
by tiago
I'm shocked on how much complex functions XYplorer can achieve through the script feature. But I'm probably missing something basic: how can I store results of looping search and match operations? I wrote a script which looks after duplicate files comparing sizes and it works well, but due to only being able to store results in clipboard I can't text() an output containing respective sizes and later selectitems() with a different list containing names only, because clipboard contains the extra info which conflicts with required format for selectitems(). Taht would be not a problem if I could store matching items in different values like I currently can via copytext(), append and I feel I am missing something basic here. Please advise.
Re: how to store more than 1 results for later reuse?
Posted: 06 Apr 2011 02:01
by tiago
Not a single hint?

Re: how to store more than 1 results for later reuse?
Posted: 06 Apr 2011 07:37
by Stefan
From reading your post I don't understood what you are after.
But one thing is guess i understood:
You can store info as text file by using writefile()
Store infos line by line or with an separator as CSV.
Use readfile() to get the infos back, maybe use ForEach and GetToken() to split info into parts.
Or use setkey() and getkey() for an ini-like file.
Re: how to store more than 1 results for later reuse?
Posted: 06 Apr 2011 15:58
by tiago
I am trying to avoid any creation of temporary files, Stefan.
They turn the whole operation slower as the data to be read increases and I bet if all the info could be handled solely on memory in execution time that would not be a problem.
Currently:
copytext {data}, a(ppend) = store results on clipboard
+
store other results in a file.
What I suggest, or looking after since perhaps this already can be done:
$$tempA = copydata {data}, a; //$$ indicator that this is for storage purposes
$$tempB = copydata {data 2}, a;
Then I can call each storage strings or add more {data} to then individually in later stages of the current operation.
Re: how to store more than 1 results for later reuse?
Posted: 07 Apr 2011 11:29
by admin
tiago wrote:I am trying to avoid any creation of temporary files, Stefan.
They turn the whole operation slower as the data to be read increases and I bet if all the info could be handled solely on memory in execution time that would not be a problem.
Currently:
copytext {data}, a(ppend) = store results on clipboard
+
store other results in a file.
What I suggest, or looking after since perhaps this already can be done:
$$tempA = copydata {data}, a; //$$ indicator that this is for storage purposes
$$tempB = copydata {data 2}, a;
Then I can call each storage strings or add more {data} to then individually in later stages of the current operation.
I wanted to do this since long. Now I did it! Next beta will have
Permanent Variables!

Re: how to store more than 1 results for later reuse?
Posted: 11 Apr 2011 00:33
by tiago
1st: thank you very much, this little feature enhancement is helping me a lot.
2nd: not that I had such problem yet but I see a potential danger or usage limitation by releasing both global and perma variables with one and the same command. So what about a differentiation between them by making available releaseglobals and releaseperma? Oh this sounds so bad...

Re: how to store more than 1 results for later reuse?
Posted: 11 Apr 2011 08:11
by admin
tiago wrote:1st: thank you very much, this little feature enhancement is helping me a lot.
2nd: not that I had such problem yet but I see a potential danger or usage limitation by releasing both global and perma variables with one and the same command. So what about a differentiation between them by making available releaseglobals and releaseperma? Oh this sounds so bad...

1st: I think this little feature enhancement will prove to be a pretty powerful thing.
2nd: Let me know if such a situation comes up. I currently don't see one.