Code: Select all
additem "Chicken Steak","",5
i just want to know how i can move the button different stack e.g stack 1 and it input the data into stack 8
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
additem "Chicken Steak","",5
It just shows the need for a feature-rich table widget that is not as complex as the Datagrid, but more usable than the primitive table object that comes with LC.dunbarx wrote:... I am amazed at how attractive they are to new users. So many start right in with them embedded in their projects, oftentimes the central control...
Craig
Sorry, still have no idea what exactly you are trying to do!?AzTheBest wrote:a button has this codethis code is in stack 8 and goes in to table called "table" in stack 8Code: Select all
additem "Chicken Steak","",5
i just want to know how i can move the button different stack e.g stack 1 and it input the data into stack 8
sturgis wrote:You can use "dispatch" or "send" for this. Look earlier in this thread for an example using dispatch.
dispatch "addItem" to <where do you want it go go? " with the info you want to go along goes here.
For example if you had a command that adds 2 numbers on a different stack, in a button on a card you could do this..
dispatch "myAddCommand" to button "addB" of card "mySpecialCard" of stack "mySpecialStack" with 2,23
Which would cause the myAddCommand in the button to fire and add numbers 2 and 23
Code: Select all
dispatch "additem" "Chicken Steak","",5 to "table" of card "8" of stack "Restraunt Template"
Code: Select all
dispatch "additem" "Chicken Steak","",5 to "table" of card "8" of stack "Restraunt Template"
i didnt name the card as a number but they all called "Restraunt Template" then next to it has (1), (2) etc.Klaus wrote:We might STILL take a look at your "additem" handler, as I already wrote!
BUT:1. You need to supply the TYPE of object that you are addressing:Code: Select all
dispatch "additem" "Chicken Steak","",5 to "table" of card "8" of stack "Restraunt Template"
... to FIELD "table"...
or:
... to GROUP "table"...
2. NEVER EVER name your objects/cards/stacks as NUMBERS! NEVER!
That is asking for trouble, since the engine does not differ between the STRING 8 and the NUMBER 8,
so it looks for a card NUMBER 8 and will throw an error if there are less cards in the target stack!
We might STILL take a look at your "additem" handler, as I already wrote!
So it is really card NUMBER 8 of that stack?AzTheBest wrote:i didnt name the card as a number but they all called "Restraunt Template" then next to it has (1), (2) etc.
Code: Select all
dispatch "additem" "Chicken Steak","",5 to "table" of card "8" of stack "Restraunt Template"
okay i did that and it worked but then script of the handler "add item" showed upKlaus wrote:I would recommend to use the correct syntax as Sturgis suggested:
...
dispatch "additem" to field "table" of card 8 of stack "Restraunt Template" WITH "Chicken Steak","",5
...
And if that does not work I will not ask a 6th time for the script of your handler "additem"
Code: Select all
command addItem pMenuItem,pDrinkItem,pCost
lock screen
if field "table" is not empty then put cr after field "table"
put pMenuItem & tab & pDrinkItem & tab & "£" & pCost & tab & 1 & tab & "£" & pCost after field "table"
if (the number of lines in field "table" mod 2) is 0 and field "table" is not empty then
else
set the backgroundcolor of line -1 of field "table" to empty
end if
unlock screen
end addItem