how to store more than 1 results for later reuse?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
tiago
Posts: 589
Joined: 14 Feb 2011 21:41

how to store more than 1 results for later reuse?

Post 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.
Power-hungry user!!!

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: how to store more than 1 results for later reuse?

Post by tiago »

Not a single hint? :(
Power-hungry user!!!

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: how to store more than 1 results for later reuse?

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

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: how to store more than 1 results for later reuse?

Post 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.
Power-hungry user!!!

admin
Site Admin
Posts: 66360
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: how to store more than 1 results for later reuse?

Post 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! :mrgreen:

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: how to store more than 1 results for later reuse?

Post 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... :roll:
Power-hungry user!!!

admin
Site Admin
Posts: 66360
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: how to store more than 1 results for later reuse?

Post 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... :roll:
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.

Post Reply