Default Directory locations

For general discussion related FlowStone
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Default Directory locations

Post by RJHollins »

Thanks for help Jay. Just knowing this saves me additional grief trying to figure out.

Thanks!
8-)
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Default Directory locations

Post by RJHollins »

OK ... in the never ending quest :lol:

I could use some guidance/critique if this is a proper technique.

Here goes. In supplying SAVED file PATHS back into the FILEDIALOG prim ... like this:
Screen-3.jpg
Screen-3.jpg (36.27 KiB) Viewed 18635 times

Is this the best way to get PATHS that is saved/loaded from a TXT file, back into the FileDialog to set a default ?

Obviously ... asking because this seems like it should work ... but it ain't really :|

Thanks for any help.

Here's the sample schematic:
Default Directory-3.fsm
(1.3 KiB) Downloaded 932 times
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Default Directory locations

Post by RJHollins »

Gee ... not even a reply :oops:

Not even, 'that's the ugliest schematic ever seen !' .... just terrible ! .... nothing ? :|

:P
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Default Directory locations

Post by Tronic »

Windows Registry can help on this case,
here an small example using the Registry class in Ruby,
I not have tested in an exported exe, so tell me if it work.

Code: Select all

# create un Registry instance
storeAppData = Registry.new

# create the KEY if not exist
# setKey method with true parameter create the KEY and return true on success
# setKey method with false can be used to check if the KEY exist and return true or false.

appKEY = "HKEY_CURRENT_USER\\SOFTWARE\\RJHollins\\APP_TEST"

until storeAppData.setKey(appKEY, false)
    storeAppData.setKey(appKEY, true)
end

registryName = "Last Open Path"
registryWriteValue = "C:\\directory"
# this write and read the REGISTRY, type can be: Bool, Int, Float, String
storeAppData.writeString(registryName, registryWriteValue)

registryReadValue = storeAppData.readString(registryName) # >> C:\\directory
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Default Directory locations

Post by RJHollins »

Hi Tronic.

I don't want to sound ungrateful, and already know You are way more experienced/knowledgeable in programming ...

But I'm hesitant to be writing into the REGISTRY. [even if that's whats happening when using some PRIMS and other FS functions]. Yeah ... you can say I'm chicken :oops: :lol:

Maybe there is no other way. I've tried many things [even with my limits], and nothing has worked consistently, and more times than not, my attempts just fail.

For some reason, the FileDialog PRIM just doesn't seem to use the 'default location' connector properly, or I'm doing something totally wrong in the sample schematic I posted above.

A solution I would prefer ... could this been done using RUBY ? Basically replacing the FileDialog PRIM with a RUBY routine ?

Again ... please don't take this wrong.
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Default Directory locations

Post by Tronic »

Anyway,
to work with,
you have to save the file paths somewhere,
in your schematic you don't save the last used path to any file or in any REG in the registry,
and you have to reload back it when restart your app,
there is no magic that FS can do.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Default Directory locations

Post by tulamide »

Tronic wrote:Anyway,
to work with,
you have to save the file paths somewhere,
in your schematic you don't save the last used path to any file or in any REG in the registry,
and you have to reload back it when restart your app,
there is no magic that FS can do.


What Tronic said. And what I said 10 days ago:

tulamide wrote:
RJHollins wrote:So specific ... the ONLY way is to Save to disk, and then AUTOLoad on startup ?

Yes.
That's how all the executables work, if they want to store settings that they want to use on the next start up. Mostly they use %APPDATA% for it.


No further comment.
"There lies the dog buried" (German saying translated literally)
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Default Directory locations

Post by RJHollins »

Guys ... the schematic example was just that ...

The WIRELESS connectors are from a SAVE/LOAD module [very standard text file]. I just didn't include that to keep the post simple.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Default Directory locations

Post by tulamide »

Don't feel offended, RJ, but for me the whole page 3 doesn't make much sense.

You post a low res image of just a part of the whole system that works together. And when it comes to the point, where you would like to get some help you say: "It ain't really working."

That's nothing I would waste my time on.

(1) Post a schematic that clearly shows the issue(s)
(2) Describe in detail, what you expect that schematic to do, and what is not working correctly.

To the point, and with as much information as needed, then you might get more help.
"There lies the dog buried" (German saying translated literally)
User avatar
Walter Sommerfeld
Posts: 250
Joined: Wed Jul 14, 2010 6:00 pm
Location: HH - Made in Germany
Contact:

Re: Default Directory locations

Post by Walter Sommerfeld »

...only mention again like tulamide and i did before:

get rid of the loop back folder splitter (including the 4 nodes)

and it should work...!

1st trigger the ini load
2nd open file dialog
3rd if done save ini...

Keep on doing!
Post Reply