How to adress a field wich is on another field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
renevanp
Posts: 10
Joined: Mon Jan 12, 2009 8:31 pm

How to adress a field wich is on another field

Post by renevanp » Mon Dec 06, 2010 10:13 pm

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

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to adress a field wich is on another field

Post by Klaus » Mon Dec 06, 2010 10:34 pm

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

renevanp
Posts: 10
Joined: Mon Jan 12, 2009 8:31 pm

Re: How to adress a field wich is on another field

Post by renevanp » Mon Dec 06, 2010 10:48 pm

Thanks,
but that won't do the trick, in my actual code I did use quotes

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: How to adress a field wich is on another field

Post by bn » Tue Dec 07, 2010 12:32 am

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

renevanp
Posts: 10
Joined: Mon Jan 12, 2009 8:31 pm

Re: How to adress a field which is on another field

Post by renevanp » Tue Dec 07, 2010 6:59 am

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))

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: How to adress a field wich is on another field

Post by bn » Tue Dec 07, 2010 9:36 am

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to adress a field wich is on another field

Post by Mark » Tue Dec 07, 2010 11:04 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: How to adress a field wich is on another field

Post by BvG » Tue Dec 07, 2010 6:04 pm

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).
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

renevanp
Posts: 10
Joined: Mon Jan 12, 2009 8:31 pm

Re: How to adress a field wich is on another field

Post by renevanp » Tue Dec 07, 2010 7:28 pm

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"

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: How to adress a field wich is on another field

Post by Mark » Tue Dec 07, 2010 7:35 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

renevanp
Posts: 10
Joined: Mon Jan 12, 2009 8:31 pm

Re: How to adress a field wich is on another field

Post by renevanp » Tue Dec 07, 2010 11:05 pm

Thank you Mark

Post Reply