affecting either all objects or wildcard objects
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
affecting either all objects or wildcard objects
Just wondering is i could so something like
on mouseUp
set the text of all fields to empty
end mouseUp
or field "price"*
on mouseUp
set the text of all fields to empty
end mouseUp
or field "price"*
Re: affecting either all objects or wildcard objects
Hi.
Of course. Do you mean all fields on one card or on other cards as well?
Anyway, there is not "all fields" capability in LC. You have to loop through the fields one by one and, if you want to, check a property as you go, and empty the field in that process:
As payment, please rewrite this to cover all cards in a stack. And then write back and tell me why "the number of fields" in the first line is such a nice thing.
Craig Newman
Of course. Do you mean all fields on one card or on other cards as well?
Anyway, there is not "all fields" capability in LC. You have to loop through the fields one by one and, if you want to, check a property as you go, and empty the field in that process:
Code: Select all
repeat with y = 1 to the number of fields
if the short name of fld y is "price" then put "" into fld y
end repeat
Craig Newman
Re: affecting either all objects or wildcard objects
No, you can't, you need to use a repeat loop:
Code: Select all
...
lock screen
repeat with i = 1 to the num of fields
put empty into fld i
end repeat
unlock screen
...
Re: affecting either all objects or wildcard objects
would that work dunbarx?
your advice worked though. thanks guys
Code: Select all
repeat with c = 1 to the num of cards
repeat with i = 1 to the num of fields
put empty into fld i of card c
end repeat
end repeat
Re: affecting either all objects or wildcard objects
Code: Select all
repeat with c = 1 to the num of cards
repeat with i = 1 to the num of fields OF CD c
put empty into fld i of card c
end repeat
end repeat
Re: affecting either all objects or wildcard objects
What Klaus said again.
Do you see? Read carefully the second line. You make no reference to the card the fields are on. This would work in the current card, because LC defaults much behavior to that state of affairs. But if you are talking about another card, the reference breaks.
This is possible if you consider the following:
The first way is better, by the way, since it is faster. You do not need to navigate to a distant card to do stuff on it. But you do need to know the difference, and the possibility.
Craig
Do you see? Read carefully the second line. You make no reference to the card the fields are on. This would work in the current card, because LC defaults much behavior to that state of affairs. But if you are talking about another card, the reference breaks.
This is possible if you consider the following:
Code: Select all
lock screen
repeat with c = 1 to the number of cards
go cd c
repeat with i = 1 to the num of fields
put empty into fld i
end repeat
end repeat
Craig
Re: affecting either all objects or wildcard objects
doh!. forgot the card reference.
i didnt need to span to other cards. it was an "on openCard" type thing that checked if a global variable asked for the fields of the card to be cleared when entering it or if they should be filled
i didnt need to span to other cards. it was an "on openCard" type thing that checked if a global variable asked for the fields of the card to be cleared when entering it or if they should be filled