Page 1 of 1

Error description: Chunk: source is not a container

Posted: Wed May 18, 2016 9:48 pm
by DavJans
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

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

Posted: Wed May 18, 2016 9:56 pm
by dunbarx
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

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

Posted: Wed May 18, 2016 10:14 pm
by DavJans
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

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

Posted: Wed May 18, 2016 10:40 pm
by DavJans
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.

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

Posted: Wed May 18, 2016 11:08 pm
by DavJans
I fixed it

put stuff into fld "whatever" OF group "whatever" not IN group

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

Posted: Thu May 19, 2016 7:44 pm
by jacque
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.