Page 1 of 1
Error : Object cannot be grouped
Posted: Mon Dec 12, 2022 5:09 pm
by CAsba
Hi,
I'm working on the title of ask and answer presentations. It will show 'CAsba', at the begining of the line, and the business name at the end of the line.
To do this I have two fields, identical properties except length and text left on one and text right on the other.
The code:
Code: Select all
on mouseup
put "CAsba" into field compnamex3 of cd "business departments"
if there is group "compnamex15" of cd "business departments" then
ungroup group "compnamex15"
end if
group field "compnamex3" of cd "business departments" and field "compnamex4" of cd "business departments"
set the name of it to "compnamex15" of cd "business departments"
put group "compnamex15" of cd "business departments" into field "fieldboxtitle" of cd template1
end mouseup
The field 'fieldboxtitle' would then be added to the ask/answer code line.
I get the error message at the 5th line. Beats me..
Re: Error : Object cannot be grouped
Posted: Mon Dec 12, 2022 5:33 pm
by richmond62
Nothing that I can see, I'm afraid:
-
Re: Error : Object cannot be grouped
Posted: Mon Dec 12, 2022 5:34 pm
by richmond62
Oh, wait a minute . . .
How do you expect to put a group into a text field?
Code: Select all
put group "compnamex15" of cd "business departments" into field "fieldboxtitle" of cd template1
That just does not make sense at all.
Re: Error : Object cannot be grouped
Posted: Mon Dec 12, 2022 5:58 pm
by Klaus
Is the button with that "mouseup" script on card "business departments"?
What is in group "compnamex15"?
Why do you UNGROUP it first?
And what Richmond said!
Re: Error : Object cannot be grouped
Posted: Mon Dec 12, 2022 6:43 pm
by stam
As others have said, the code you posted doesn't make much sense.
Rather than code, can you post what you're trying to achieve? (with as much detail as possible as it's often the case that what is being asked can be perceived quite something when detail is lacking...). Then people can try to help...
S.
Re: Error : Object cannot be grouped
Posted: Mon Dec 12, 2022 7:09 pm
by dunbarx
CAsba.
There is, however, something to learn here. Fields are containers and contain only text. You cannot put an object into a field.
Because only a container (a reserved LC name) can go into a container.
But you can put the contents of an object into a field:
Code: Select all
on mouseUp
put "XYZ" into btn 1
put btn 1 into fld 1
end mouseUp
Because a button is a container. This goes way back to HC.
Craig
Re: Error : Object cannot be grouped
Posted: Mon Dec 12, 2022 7:47 pm
by mwieder
Based on your original post
I'm working on the title of ask and answer presentations. It will show 'CAsba', at the begining of the line, and the business name at the end of the line.
I think what you want is more like
Code: Select all
on mouseUp
put field "compnamex3" of cd "business departments" && field "compnamex4" of cd "business departments" into field "fieldboxtitle" of cd template1
end mouseUp
Re: Error : Object cannot be grouped
Posted: Tue Dec 13, 2022 2:37 pm
by CAsba
Thank you guys, I didn't know that groups can't be put into fields. I appreciate your responses very much.
Re: Error : Object cannot be grouped
Posted: Tue Dec 13, 2022 3:35 pm
by dunbarx
CAsba.
I didn't know that groups can't be put into fields.
Assume for a moment you could. What would that look like? Could you put a card or stack into a field? A banana?
Craig
Re: Error : Object cannot be grouped
Posted: Tue Dec 13, 2022 6:45 pm
by mwieder
Craig- if you think of a group not as a group of controls but as a group of texts contained in the aggregated controls then it does make sense.
Re: Error : Object cannot be grouped
Posted: Tue Dec 13, 2022 9:09 pm
by dunbarx
Mark.
Hmmm. I suppose one could think of a group as anything at all. But in instructing a new user I wanted to make a clear distinction between the nature of a source container and the nature of a destination container. And what a container is and needs to be in the first place.
Hence the banana.
Craig
Re: Error : Object cannot be grouped
Posted: Tue Dec 13, 2022 10:02 pm
by jacque
I can see how it would be confusing because if you say "put fld 1" you get the text of the field. You don't have to specify "the text of fld 1". It's a shortcut that goes back to HC. So why couldn't you say "put grp 1" and get the text?
We take a lot for granted when things become habitual.
Re: Error : Object cannot be grouped
Posted: Tue Dec 13, 2022 10:54 pm
by dunbarx
Jacque.
So why couldn't you say "put grp 1" and get the text?
Because group 1 might consist of two images, a scrollbar and a line graphic?
Craig
Re: Error : Object cannot be grouped
Posted: Tue Dec 13, 2022 11:07 pm
by jacque
If the syntax were consistent we'd probably get the binary representation.

Re: Error : Object cannot be grouped
Posted: Wed Dec 14, 2022 12:23 am
by dunbarx
I have rarely had consistent syntax. In fact, I rarely have syntax at all.
Craig