Page 1 of 1
How to adress a field wich is on another field
Posted: Mon Dec 06, 2010 10:13 pm
by renevanp
Hello,
I have put a field (aField) on an scrolling field (SField)
How can i put text into that field (with the name afield)?
put "xxx" into aField creates an error no such chunk
Re: How to adress a field wich is on another field
Posted: Mon Dec 06, 2010 10:34 pm
by Klaus
Hi Rene,
you have to tell Livecode what kind of object you want to address AND its name!
...
put "xxx" into FIELD "aField"
## can also be abbreviated with: fld
## less typing

...
And the names always in quotes as in my example!
Best
Klaus
Re: How to adress a field wich is on another field
Posted: Mon Dec 06, 2010 10:48 pm
by renevanp
Thanks,
but that won't do the trick, in my actual code I did use quotes
Re: How to adress a field wich is on another field
Posted: Tue Dec 07, 2010 12:32 am
by bn
Rene,
the quotes around names of objects are highly recommended. But the problem with your script was not the quotes but, what Klaus pointed out in his script:
put "xxx" into FIELD "aField"
you did not indicate
the kind of object you want to put "xxx" into, you just said aField. This is the name of the object. You have to reference the field also.
put "something" into ObjectType "objectName"
regards
Bernd
Re: How to adress a field which is on another field
Posted: Tue Dec 07, 2010 6:59 am
by renevanp
Thank you Bernd,
But that's not the problem too, i do use put "something" into ObjectType "objectName"
I just didn't quote it right her in the forum, sorry.
I think I need something like this:
put ""xx" into field "AField" of field "SField"
If i use this i get an error : (Chunk: bad chunk order (must be small to large))
Re: How to adress a field wich is on another field
Posted: Tue Dec 07, 2010 9:36 am
by bn
Rene,
I am afraid I don't understand what you are doing.
I have put a field (aField) on an scrolling field (SField)
I you zip the stack you can upload it to the forum and I think it will be clearer what you want to do.
What I get is: you overlay field "aField" on top of the scrolling field "SField" If that is the case Klaus code should work.
If it does not then there must be something else that is going wrong.
I think it is a problem of terminology/describing what exactly you want to do.
Kind regards
Bernd
Re: How to adress a field wich is on another field
Posted: Tue Dec 07, 2010 11:04 am
by Mark
Hi renevanp,
You can't refer to a field by means of another field. Field "x" of field "y" is impossible. The question is: why do you want to do this? If you can explain that, we might provide you with a better solution.
Kind regards,
Mark
Re: How to adress a field wich is on another field
Posted: Tue Dec 07, 2010 6:04 pm
by BvG
maybe one field is showing above the other field, covering it (partly) up?
then you'd need to check the location of the fields in regards to each other, for example with the within function or the intersect function (look them up in the dictionary).
Re: How to adress a field wich is on another field
Posted: Tue Dec 07, 2010 7:28 pm
by renevanp
Hi All,
Thanks for the input
What I want(ed) is a Scrolling field containing a (large) number of fields, so I would be able to scroll down.
Just like you can put field directly on a card, I thought you could place a field on a scrolling list
I see now that you can't make a field part of a scrolling field.
Is there another way of achieving my goal?
I will look again at my code and try to figure out why I was not able to put something in my field named "afield"
Re: How to adress a field wich is on another field
Posted: Tue Dec 07, 2010 7:35 pm
by Mark
Hi renevanp ,
Just make a group of all your fields. Set the lockLoc of your group to true and add vertical and horizontal scroll bars (use the property inspector).
Kind regards,
Mark
Re: How to adress a field wich is on another field
Posted: Tue Dec 07, 2010 11:05 pm
by renevanp
Thank you Mark