is this possible??
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
is this possible??
i have a field that i enter say a name "bob smith". and when i press a button, it transfer this name to a table.
is there a way, that if i enter this name in again, that it could search for the name, and if it finds the name "bob smith" in this table, it could but another bob smith name either 7 rows before or after (what ever row is available) ???
is this possible ??
cheers
is there a way, that if i enter this name in again, that it could search for the name, and if it finds the name "bob smith" in this table, it could but another bob smith name either 7 rows before or after (what ever row is available) ???
is this possible ??
cheers
Hi smash,
I am not sure, but maybe you are looking for something like this:
Or if you need the line number:
Hope that helps.
Best
Klaus
I am not sure, but maybe you are looking for something like this:
Code: Select all
...
if fld "Your Table field here" contains "Bob Smith" then
## Do whatever you want, there is already a bob Smith in the field
end if
...
Code: Select all
...
put lineoffset("Bob Smith",fld "Your Table field here") into already_there
if already_there = 0 then
## No Bob Smith in field
else
## Bob Smith is already there in line number "already_there" :)
end if
...
Best
Klaus
Dear Smash,
Store the data in a custom property and add a search field to your stack. In the keyUp handler of the search field, include a script that takes the custom property and filters out the relevant data. Put the filtered data into another field. That's all.
Best,
Mark
Store the data in a custom property and add a search field to your stack. In the keyUp handler of the search field, include a script that takes the custom property and filters out the relevant data. Put the filtered data into another field. That's all.
Code: Select all
on keyUp
put the cData of this cd into myList
filter myList (with the text of me & "*")
put myList into fld "Results"
end keyUp
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
hi klaus
this is my script for putting them into the "Enties" table
so i kind of need something that would "search" to see if the name is allready in there, and go 7 rows down or up (what ever row is empty after 7 rows)
would really appreciate some help.
hi mark, i dont have a custom property for storing data, as this is more like an entry form, so it would change with every useage.
i hope the script i put up, explains what i am trying to do.
thank you both for your replies
would really love to try and solve this
this is my script for putting them into the "Enties" table
now the problem is, there can be upto 600 new names for each show (this is like an entry form)on mouseUp
set the opaque of me to false
local theCardName
put "Entries" into theCardName
put the label of me after theCardName
if (field "HorsesName" is not empty) and (field "RidersName" is not empty) then
add 1 to field "BridleNumber"
put field "BridleNumber" & tab & field "HorsesName" & tab & field "RidersName" & return after field "Entries" of card "Entries5"
else
answer "You have not completed the entry details correctly"
end if
end mouseUp
so i kind of need something that would "search" to see if the name is allready in there, and go 7 rows down or up (what ever row is empty after 7 rows)
would really appreciate some help.
hi mark, i dont have a custom property for storing data, as this is more like an entry form, so it would change with every useage.
i hope the script i put up, explains what i am trying to do.
thank you both for your replies
would really love to try and solve this
So.... smash... create that custom property if you don't have it. If it really makes no sense to use a custom property, then use avariable. The idea behind this method still is the same.
Best,
Mark
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
sorry mark, but i just dont understand what a custom property is or how to create one.So.... smash... create that custom property if you don't have it. If it really makes no sense to use a custom property, then use avariable. The idea behind this method still is the same.
Best,
Mark
could you be so kind to explain it to me
cheers
ummm thanks mark, but in all honesty, that "user guide" might as well be in chinese. i just have never been able to work out anything from that guideDear Smash,
Please, read page 229 and further of the user guide.
Best,
Mark



sorry, but i still dont understand
is there another way to explain it to me ???
cheers
Hi smash,
Please read my post especially the second proposal with lineoffset, which will give you the number of the line where the name (or whatever) is in the field!
If "lineoffset" = 0 then the name is not in the field!
So you have the line number and you can count up or down from there until you find an empty line or whatever you want to.
Best
Klaus
I already gave a solution on how to find something in a field!smash wrote:...
now the problem is, there can be upto 600 new names for each show (this is like an entry form)
so i kind of need something that would "search" to see if the name is allready in there, and go 7 rows down or up (what ever row is empty after 7 rows)
would really appreciate some help.
Please read my post especially the second proposal with lineoffset, which will give you the number of the line where the name (or whatever) is in the field!
If "lineoffset" = 0 then the name is not in the field!
So you have the line number and you can count up or down from there until you find an empty line or whatever you want to.
Best
Klaus
sorry klaus,
i can not get either script to work, as i can not use a name of a person as such in the script.
i will try to explain a bit better.
i have several text fields
example "riders name" and "horses name" and a button that transfers these two fields into a table.
the rider may enter 2 horses.
so i need the rider to be transtered to the table at least 7 rows difference, in the same table;
eg
tammy smith ......... black beauty
>
>
>
>
tammy smith .........snowy
now there could say 30 riders, riding 2 horses each
so it could look like this
tammy smith .....black beauty
joe black .......silver
dot taylor......casper
tammy smith ....snowy
joe black ........tonto
dot taylor .......dusty
does that make any sense klaus ??
cheers
i can not get either script to work, as i can not use a name of a person as such in the script.
i will try to explain a bit better.
i have several text fields
example "riders name" and "horses name" and a button that transfers these two fields into a table.
the rider may enter 2 horses.
so i need the rider to be transtered to the table at least 7 rows difference, in the same table;
eg
tammy smith ......... black beauty
>
>
>
>
tammy smith .........snowy
now there could say 30 riders, riding 2 horses each
so it could look like this
tammy smith .....black beauty
joe black .......silver
dot taylor......casper
tammy smith ....snowy
joe black ........tonto
dot taylor .......dusty
does that make any sense klaus ??
cheers
hi klaus,
LOL yes i did make sure i but in my fields LOL
i have tried many senerios
another one i tried
put lineoffset("RidersName",fld "Entries") into already_there
if already_there = true then
lineskip =7
but they all causes the button not to work.
thank you mwieder, but i cant put the "actual" name into the script, as i dont know it, and their is no way i can store "data" as such.
it is like a contest, so i have no idea on who would be entering (if that makes sense).
once the contest is over, you start again.
this is so frustrating.
LOL yes i did make sure i but in my fields LOL
i have tried many senerios
another one i tried
put lineoffset("RidersName",fld "Entries") into already_there
if already_there = true then
lineskip =7
but they all causes the button not to work.
thank you mwieder, but i cant put the "actual" name into the script, as i dont know it, and their is no way i can store "data" as such.
it is like a contest, so i have no idea on who would be entering (if that makes sense).
once the contest is over, you start again.
this is so frustrating.
Dear Smash,
Just create a new stack to experiment with. Create three fields: "Data", "Results" and "Search". The search field should be one line high, the other fields should have several lines and should be scrolling fields.
Set the script of field "Search" to:
Put the following data into field "Data":
Aaron
Bernard
Chloe
Chris
Cindy
Dart Vader
Now type a C in field "Search". You will see that the results field now contains:
Chloe
Chris
Cindy
Type an h after the C and you will see that the Results field contains
Chloe
Chris
It works!
Best,
Mark
Just create a new stack to experiment with. Create three fields: "Data", "Results" and "Search". The search field should be one line high, the other fields should have several lines and should be scrolling fields.
Set the script of field "Search" to:
Code: Select all
on keyUp
put fld "Data" into myList
filter myList (with the text of me & "*")
put myList into fld "Results"
end keyUp
Aaron
Bernard
Chloe
Chris
Cindy
Dart Vader
Now type a C in field "Search". You will see that the results field now contains:
Chloe
Chris
Cindy
Type an h after the C and you will see that the Results field contains
Chloe
Chris
It works!
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi smash,
Please, please, please go to the Revolution Dictionary and check the appropriate entries if you are not sure!
"lineoffset" will return the NUMBER of the line where the string was found or 0 (ZERO) if nothing was found.
I think this was unambiguous in my script!
And we still have no idea what you mean with 7 lines up or down???
Do you want to replace the date 7 lines up or down or what?
Of course you must write:put lineoffset("RidersName",fld "Entries") into already_there
if already_there = true then
Code: Select all
put lineoffset(FIELD "RidersName",fld "Entries") into already_there
if already_there <> 0 then
Please, please, please go to the Revolution Dictionary and check the appropriate entries if you are not sure!
"lineoffset" will return the NUMBER of the line where the string was found or 0 (ZERO) if nothing was found.
I think this was unambiguous in my script!
And we still have no idea what you mean with 7 lines up or down???
Do you want to replace the date 7 lines up or down or what?