Posts: 60
Threads: 24
Joined: Jan 2008
Hey i was wondering.
Im usin rget and rset
But i am unsure on how to add things to it Without overwriting what was already there.
Say i have information in it like:
My Name: Tyler
Then next time i use it i want to add my Hobby.
My Hobby: Football
So in the registry there will be
My Name:Tyler
My Hobby: Football
Thanks,
Tyler
Posts: 12,066
Threads: 140
Joined: Dec 2002
It is easier to use two separate registry values for name and hobby.
Macro
rset "Tyler" "My Name" "\Tyler"
rset "Football" "My Hobby" "\Tyler"
Here \Tyler is your key (it is like a folder) where you can store My Name, My Hobby and other values.
Posts: 60
Threads: 24
Joined: Jan 2008
Oh i get you,
So you think, if i had a dialog and they enter a text,
and when they press a Enter button, it stores in Registry
something like
str a.getwintext(id(1 "Dialog"))
rset a "\Tyler"
:?:
Posts: 12,066
Threads: 140
Joined: Dec 2002
In my examples, there are 3 arguments, not 2. Everytime use a different string for the second argument, and then registry values will not be overwritten.
Posts: 60
Threads: 24
Joined: Jan 2008
But then how would you rget that for future reference ?
Posts: 12,066
Threads: 140
Joined: Dec 2002
Use the same second and third arguments as with rset.
Did you ever used regedit.exe?
Posts: 60
Threads: 24
Joined: Jan 2008
Hi, need some help again lol
If i have a function with this..
Function 1:
str Name
if(!inp(Name "Enter your First Name here" " RudeBoi's Rapid Caddy" "Enter Your Name")) ret
rset Name "DialogHello" "\Tyler"
In a new function how would i rget but use in a string?
str hello
hello="Hi,"
hello+rget "DialogHello" "\Tyler"
out hello
I Know that doesn't work, but thats what i want it to do
so it ends up Hi,Tyler in the out box
Posts: 12,066
Threads: 140
Joined: Dec 2002
Macro
str hello
rget hello "DialogHello" "\Tyler"
hello-"Hi,"
out hello
Posts: 60
Threads: 24
Joined: Jan 2008
Thanks man
works great
Posts: 60
Threads: 24
Joined: Jan 2008
If i have a dialog where they enter a name in an Edit box.
And then press a button "Save"
so it saves to registry.
But everytime i do this it overwrites.
How could i prevent this from happening.
Can you tell me the rget and rset to do this.
The idea is a storage list
Thanks,
Tyler
Posts: 12,066
Threads: 140
Joined: Dec 2002
Macro
str names name
rget names "names" "\Test" ;;get the list
out; out "-- All names --"; out names
if(!inp(name "Add new name") or !name.len) ret
names.addline(name) ;;add to the list
rset names "names" "\Test" ;;save the list