Page 1 of 1

error can't find background

Posted: Sat Nov 23, 2013 5:40 pm
by chris25
LiveCode won't stop moaning and complaining and grumbling that it can't find the background in line 6 of this code. I have checked and re-checked each object is a group all by itself, each group is named the same as each object was originally named.What maybe are the reasons for saying that it can not find a backgound? I realise it is looking for a background because it sees a group.

Code: Select all

command initializeMines 
     repeat with i = 1 to 10
          put "mines" & i into gMinesBegin
          put 150 + (i-1)*100 into gMinesX
          put 50 into gMinesY
      set the loc of grp gMinesBegin to gMinesX, gMinesY
     end repeat
end initializeMines

Re: error can't find background

Posted: Sat Nov 23, 2013 5:47 pm
by Klaus
Are you sure that all 10 groups exist on the card where you execute this command:
mines1
...
mines10
?

Re: error can't find background

Posted: Sat Nov 23, 2013 6:12 pm
by chris25
Yes Klaus, all 10 objects exist on the one and only card. Plus the script in this case is on that same card.
Chris

Re: error can't find background

Posted: Sat Nov 23, 2013 6:37 pm
by Klaus
Add an answer dialog, maybe that will give you a hint:

Code: Select all

command initializeMines 
     repeat with i = 1 to 10
          put "mines" & i into gMinesBegin
          put 150 + (i-1)*100 into gMinesX
          put 50 into gMinesY

        if there is NOT a grp gMinesBegin then
           answer "No group:" && gMinesBegin
           exit to top
        end if

        set the loc of grp gMinesBegin to gMinesX, gMinesY
     end repeat
end initializeMines
You can also ZIP the stack and post it here!

Re: error can't find background

Posted: Sat Nov 23, 2013 7:18 pm
by chris25
Stepping through the breakpoints and the answer box revealed no group mines 1.. It was an 's' . I'm on the screen 6 hours a day. No excuse, no excuse.

Klaus, once again, what can I say, thanks.

Re: error can't find background

Posted: Sat Nov 23, 2013 8:20 pm
by dunbarx
Chris.

HAHAHAHAHA.

I knew you find a moment when you begrudgingly realized how a comma can ruin your day, but is not, particularly, the fault of LiveCode.

Welcome to our world. And no more griping, please. You are beyond that now, whether you like it or not.

Craig

Re: error can't find background

Posted: Sun Nov 24, 2013 12:11 am
by chris25
I know I know, griping is well and truly over now, I've grown up :D But maybe I should have posted a smiley after first line as it really was not a gripe, just my long winded oddish way to say I don't know why....trying to bring smiles to my often laborious and tiresome questioning, I know you all have feelings as well...