Error description: Chunk: source is not a container

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
DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Error description: Chunk: source is not a container

Post by DavJans » Wed May 18, 2016 9:48 pm

dDates looks like this:

5/14
5/13
5/12
5/11
5/10
5/9
5/8

I am not trying to puch each line into a separate field with the code below but getting the error AFTER field wdate7 IS filled in with line 1 of dDates. So, my stupid brain says "well every source was a container at some point if it worked once"
put "7" into dateField
repeat for each line tLine in dDates
switch dateField
case 1
put tLine into fld "wdate1" in group "gWeek"
BREAK
case 2
put tLine into fld "wdate2" in group "gWeek"
BREAK
case 3
put tLine into fld "wdate3" in group "gWeek"
BREAK
case 4
put tLine into fld "wdate4" in group "gWeek"
BREAK
case 5
put tLine into fld "wdate5" in group "gWeek"
BREAK
case 6
put tLine into fld "wdate6" in group "gWeek"
BREAK
case 7
put tLine into fld "wdate7" in group "gWeek"
BREAK
end switch
put dateField - 1 into dateField
end repeat
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Error description: Chunk: source is not a container

Post by dunbarx » Wed May 18, 2016 9:56 pm

Hi.

What is in "dDates"?

Anyway, running the handler as is, where dDates is simply "dDates", since you did not do anything with it, so it has one line, produces no error.

That is, assuming there is a field "wDate7".

Craig Newman

DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Re: Error description: Chunk: source is not a container

Post by DavJans » Wed May 18, 2016 10:14 pm

DavJans wrote:dDates looks like this:

5/14
5/13
5/12
5/11
5/10
5/9
5/8
Its just a variable with 7 lines of dates
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Re: Error description: Chunk: source is not a container

Post by DavJans » Wed May 18, 2016 10:40 pm

As I mentioned earlier it it does put the correct data into field "wdate7"

So I did some testing and I have narrowed it down if it helps any of you smarter people help me.

case 7
answer "Hi"
put tLine into fld "wdate7" in group "gWeek"
BREAK

In this case I get a popup that tells me Hi as expected
Then it puts the correct data into field "wdate7"
then I get the error

now, if I switch it up like so:

case 7
put tLine into fld "wdate7" in group "gWeek"
answer "Hi"
BREAK

In this case the correct data is put into field "wdate7"
Then I get the error, No pop up greeting me.
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

DavJans
Posts: 275
Joined: Thu Dec 12, 2013 4:21 pm

Re: Error description: Chunk: source is not a container

Post by DavJans » Wed May 18, 2016 11:08 pm

I fixed it

put stuff into fld "whatever" OF group "whatever" not IN group
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Error description: Chunk: source is not a container

Post by jacque » Thu May 19, 2016 7:44 pm

There's a quicker way to get the data into the field without running a repeat loop:

Code: Select all

put "7" into dateField
put ("wdate"&dateField) into tFld -- creates the field name
put line dateField of dDates into field tFld of group "gWeek"
This assumes that your dates are in the right order, with field 1 being line 1 of the date list.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply