Naming Groups
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Naming Groups
I seem to be having some trouble with naming groups.
I was attempting to make it work in a wider script but have tried it independently on a stack by itself and can't get it to work for the life of me.
Got two fields, Field1 and Field 2, this is what I've got on a button:
on mouseUp
set the name of templateGroup to "Misery"
answer the name of the templateGroup
group field "Field1" and field "Field2"
end mouseUp
I've also tried using "set the name of the last group" but I know 'last' has had some problems with groups anyway.
All the same, this doesn't affect the new group at all. I can't change any of the properties of the new group through use of the templateGroup.
How do I create a group and set its name at the same time?
I was attempting to make it work in a wider script but have tried it independently on a stack by itself and can't get it to work for the life of me.
Got two fields, Field1 and Field 2, this is what I've got on a button:
on mouseUp
set the name of templateGroup to "Misery"
answer the name of the templateGroup
group field "Field1" and field "Field2"
end mouseUp
I've also tried using "set the name of the last group" but I know 'last' has had some problems with groups anyway.
All the same, this doesn't affect the new group at all. I can't change any of the properties of the new group through use of the templateGroup.
How do I create a group and set its name at the same time?
Re: Naming Groups
Code: Select all
on mouseUp
group fld 1 AND fld 2
set the name of the last group of this card to "fldgroup"
end mouseUp
Re: Naming Groups
Really? All I was missing was "of this card"? Damn.
Thanks Dixie!
Thanks Dixie!
Re: Naming Groups
HI A1Qicks,
1. welcome to the forum!
2. All modifications to "the templateXXX" only stick when you later do:
...
create group
## button/field etc...
...
Best
Klaus
1. welcome to the forum!

2. All modifications to "the templateXXX" only stick when you later do:
...
create group
## button/field etc...
...
Best
Klaus
Re: Naming Groups
Hi Klaus! It's nice to be here. I'm a stone cold beginner to coding entirely, so I'll probably be posting a fair few dumb questions...
And thanks for the bonus info! I was working by scouring old forum posts and couldn't quite follow the layout of them.
What's the phrasing for then adding an object to an existing group?
For example with 'create group', and then trying to put a field into it.

And thanks for the bonus info! I was working by scouring old forum posts and couldn't quite follow the layout of them.
What's the phrasing for then adding an object to an existing group?
For example with 'create group', and then trying to put a field into it.
Re: Naming Groups
Hi A1Qicks,
always remember that Livecode is VERY english like, so:
...
create field "name of new field here" in group "your group here"
...
Please also take a look at these stacks:
http://www.hyperactivesw.com/revscriptc ... ences.html
Very good learning resources!
Best
Klaus
always remember that Livecode is VERY english like, so:
...
create field "name of new field here" in group "your group here"
...

Please also take a look at these stacks:
http://www.hyperactivesw.com/revscriptc ... ences.html
Very good learning resources!
Best
Klaus
Re: Naming Groups
Next stupid question - unrelated but I didn't think it warranted its own topic.
In putting text into something, how do you specific a line break?
e.g. I've currently got
put "<" && the text of field "nameField" && ">" && the text of field "textEntry" after field "displayMessage"
but I want it to put a line break before putting that as a new line.
In putting text into something, how do you specific a line break?
e.g. I've currently got
put "<" && the text of field "nameField" && ">" && the text of field "textEntry" after field "displayMessage"
but I want it to put a line break before putting that as a new line.
Re: Naming Groups
Hi A1Quicks,
Kind regards
Bernd
try "cr" or "return"put "<" && the text of field "nameField" && ">" && the text of field "textEntry" after field "displayMessage"
Code: Select all
put "<" && the text of field "nameField" && ">" && cr & the text of field "textEntry" after field "displayMessage"
Bernd