Hi guys,
I am in need of some help with data recalling and storing.
I'm working on something which requires the user to input a set of variables, and be able to recall all of those variables at a later time by entering any one of those variables.
For example:
The user inputs 1VarA, 1VarB, 1VarC and 1VarD. This is then stored somewhere.
Then the user inputs 2VarA, 2VarB, 2VarC and 2VarD. This is stored somewhere else.
Now, when the user wants to search for that set of variables all they need to do is type in one of those variables for the others to show up. So for the first set of variables to pop up the user needs to input any one of those 4 from the first set.
The main problem i am having is linking up those variables to one another. I can get the language to recall one of these variables but i need it to bring up the entire set. I just need to know how to link up these variables.
Thanks.
Data storing and recalling
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Data storing and recalling
I have no clue what you actually mean, sorry. Therefore a random script, maybe it is what you want?
Code: Select all
local 1VarA, 1VarB, 1VarC, 1VarD
on mouseUp
if field "2VarA" = 1VarA then
put 1VarA, 1VarB, 1VarC, 1VarD
end if
end mouseUp
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Data storing and recalling
Try this in the script of a field:
I worked this with the exact examples you originally posted. You enter data, and when the enter key is pressed, your data is stored as a set of custom properties in the field itself.
If you enter data that already exists, the property is loaded into the field.
Now this only retrieves when the first item in a data set is entered, since I have named the properties after that first item. But it should get you started. You may have to worry about return, delete, backspace, editing in the middle of the text, etc.
Craig Newman
Code: Select all
on enterinfield
put me into temp
put item 1 of me into tGroup
set the tGroup of me to temp
put "" into me
end enterinfield
on keyDown var
put var after the selection
put the customProperties of me into temp
combine temp with return
if the length of me = 5 and me is in temp then
put me into tGroup
put the tGroup of me into me
end if
end keyDown
If you enter data that already exists, the property is loaded into the field.
Now this only retrieves when the first item in a data set is entered, since I have named the properties after that first item. But it should get you started. You may have to worry about return, delete, backspace, editing in the middle of the text, etc.
Craig Newman