set the backgroundpattern error

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
vedus
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 153
Joined: Tue Feb 26, 2013 9:23 am

set the backgroundpattern error

Post by vedus » Sat Dec 06, 2014 4:20 pm

i have a datagrid with 2 labels and 1 graphic (form)
i am using the switch to filter the data i get something like bellow

Code: Select all

   case "Liqueurs"
               put revQueryDatabase(sConnID,"SELECT rowid FROM datadrinks where cat like 'liq%' ") into sCursorID
               break
          case "noalco"
               put revQueryDatabase(sConnID,"SELECT rowid FROM datadrinks where cat like 'Non%' ") into sCursorID
               break
i want to change the graphic pattern of the rectangle that i have in the form so i try the bellow

Code: Select all

 set the backgroundpattern  of graphic id 1068 of group id "1012" of card id 1011 of stack "Data Grid Templates 1417794119370" to image id 1053 of card id 1002 of stack "images"
but always i get error
execution error at line 4 (Object: can't set object property), char 2
what i do wrong here?

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

Re: set the backgroundpattern error

Post by Klaus » Sun Dec 07, 2014 12:59 pm

Hi vedus,

you need to set this property (backgroundpattern) to a NUMBER or an expression that resolves to a number!
This: "...image id 1053 of card id 1002 of stack images" is not a number 8)

Try this:
...
set the backgroundpattern of graphic id 1068 of group id "1012" of card id 1011 of stack "Data Grid Templates 1417794119370" to 1053
...


Best

Klaus

vedus
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 153
Joined: Tue Feb 26, 2013 9:23 am

Re: set the backgroundpattern error

Post by vedus » Sun Dec 07, 2014 4:51 pm

thank you klaus,fixed..

Post Reply