controlIDs|Names of group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark
Re: controlIDs|Names of group
Hi all,
dumb question: Should there be empty lines in the controlIDs of this cd?
Best,
Malte
dumb question: Should there be empty lines in the controlIDs of this cd?
Best,
Malte
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: controlIDs|Names of group
possibly dumber question: are you saying you *want* empty lines or that you currently see empty lines?
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: controlIDs|Names of group
There shouldn't be no... There could be in controlNames in 6.5+ because the short name now returns empty instead of the abbrev id if the name is empty.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: controlIDs|Names of group
Right. I was looking at controlIDs for sure which came up with empty lines, while I was trying to speed up revGeometry. Should I file this as a bug along with a stack?
Re: controlIDs|Names of group
Ooo.... I see one... weird, trying to work out how it's possible
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: controlIDs|Names of group
Found it... not handling empty groups, I'll submit a pull request in a sec
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: controlIDs|Names of group
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: controlIDs|Names of group
You're a star. Tis about time that all the contributors put the whiskey delivery add in their signatures.
Re: controlIDs|Names of group
No longer in 6.5-rc-1 - I reverted that 'fix' (bug 10981) as it was the wrong way to fix the problem (which has been around for an age) - see bug 11352.There shouldn't be no... There could be in controlNames in 6.5+ because the short name now returns empty instead of the abbrev id if the name is empty.
Thanks @monte - shouldn't be a problemHopefully it will make 6.5 and maybe 6.1.3???
Re: controlIDs|Names of group
Hold your whiskey @malte... it was my bug in the first place... a little embarrassing as it's now the second time on the one feature I've been caught out by empty groups... early on they crashed the engine!
@runrevmark
I have had occasion to wish that something like this didn't throw an execution error:
The only workaround I've found is:
Any chance that while your meddling to allow control "control id 1002" to work that you might allow that to work too?
The particular use case I can think of at the moment is in lcVCS where I need to iterate over all the cards a shared object is on to get the unshared properties.
@runrevmark
I have had occasion to wish that something like this didn't throw an execution error:
Code: Select all
put the long id of this cd into tCard
put the abbrev id of me into tAbbrevID
get the htmlText of tAbbrevID of tCard
Code: Select all
put tAbbrevID && "of" && tCard into tObjectRef
get the htmlText of tObjectRef
The particular use case I can think of at the moment is in lcVCS where I need to iterate over all the cards a shared object is on to get the unshared properties.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: controlIDs|Names of group
@monte: You wouldn't be able to quite do that, but you would be able to do:
The thing that came out of that incorrect bug fix was two-fold:
Firstly that if the short name can return '<type> id <id>', then you should be able to reference it in chunks:
This throws an error at the moment as 'card id ...' isn't considered a 'name' of an object (unlike card "...", or ...).
The second is that there is no general way to resolve a long id of an object as an object reference, which is a problem when you want to perform a 'string' operation on an object:
This would be solved by making it so that if you have a control chunk in isolation, then it will resolve a full object reference; but if it is part of a sequence of chunks, it must only be something the engine considers to be a name of the object.
Code: Select all
put the long id of this cd into tCard
put the abbrev id of me into tAbbrevID
get the htmlText of [b]card[/b] tAbbrevID of tCard
Firstly that if the short name can return '<type> id <id>', then you should be able to reference it in chunks:
Code: Select all
put the htmlText of card (the short name of card 1) -- assume card 1's short name returns 'card id 1002'
The second is that there is no general way to resolve a long id of an object as an object reference, which is a problem when you want to perform a 'string' operation on an object:
Code: Select all
put the long id of field 1 into tFieldObj
put word 1 of the text of tFieldObj -- works as the property access makes it clear you want to interpret tFieldObj as an object
put word 1 of tFieldObj -- gives you 'field', as this is a string operation
Code: Select all
put the long id of field 1 into tFieldObj
put word 1 of field tFieldObj -- works
put word 1 of field tFieldObj of card 2 -- throws an error as 'tFieldObj' already contains a card reference
Hmmm - I think it would be more efficient to use a hard coded chunk for this:The particular use case I can think of at the moment is in lcVCS where I need to iterate over all the cards a shared object is on to get the unshared properties.
Code: Select all
repeat for each line tCardId in tCardIdsControlIdIsOn
get the <prop> of control id tControlId of card id tCardId
...
end repeat
Re: controlIDs|Names of group
OK...runrevmark wrote:@monte: You wouldn't be able to quite do that, but you would be able to do:Code: Select all
put the long id of this cd into tCard put the abbrev id of me into tAbbrevID get the htmlText of [b]card[/b] tAbbrevID of tCard
In this particular instance I have the card long id and the control id. I'm actually putting together a long id then using that because I can't:runrevmark wrote: Hmmm - I think it would be more efficient to use a hard coded chunk for this:Code: Select all
repeat for each line tCardId in tCardIdsControlIdIsOn get the <prop> of control id tControlId of card id tCardId ... end repeat
Code: Select all
get the <prop> of control id tControlId of tCardRef
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: controlIDs|Names of group
@monte:
What breaks with:
Here - as long as tControlId is a number and tCardRef is a long id, the engine should resolve tCardRef as a long id (of a card), which it should then search for a control id tControlId in...
What breaks with:
Code: Select all
get the <prop> of control id tControlId of tCardRef
Re: controlIDs|Names of group
Woops... nothing... it must have been that I had <abbrevid> of <long card id> that was failing... I'll change to this
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: controlIDs|Names of group
Would anyone else like child<any object type>IDs & <any object type>IDs ? I think it would be quite helpful...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/