Page 3 of 4
Re: Basket help
Posted: Sat Jun 18, 2016 6:06 pm
by AzTheBest
a button has this code
this code is in stack 8 and goes in to table called "table" in stack 8
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

Re: Basket help
Posted: Sat Jun 18, 2016 6:19 pm
by sritcp
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
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.
It is a major deficiency that needs to be corrected.
Regards,
Sri
Re: Basket help
Posted: Sat Jun 18, 2016 6:24 pm
by Klaus
AzTheBest wrote:a button has this code
this code is in stack 8 and goes in to table called "table" in stack 8
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

Sorry, still have no idea what exactly you are trying to do!?
Please also post the script of your "additem" handler!
Are you really naming your stacks with numbers?
Re: Basket help
Posted: Sat Jun 18, 2016 6:25 pm
by sturgis
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
Re: Basket help
Posted: Sat Jun 18, 2016 6:39 pm
by AzTheBest
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"
i keep getting error as i did find this online to? but im guessing putting the code in wrong?

Re: Basket help
Posted: Sat Jun 18, 2016 6:52 pm
by Klaus
We might STILL take a look at your "additem" handler, as I already wrote!
BUT:
Code: Select all
dispatch "additem" "Chicken Steak","",5 to "table" of card "8" of stack "Restraunt Template"
1. You need to supply the TYPE of object that you are addressing:
... 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!
Re: Basket help
Posted: Sat Jun 18, 2016 6:59 pm
by AzTheBest
okay i edited my code thanks but still no luck haha
to anwser ur question it is a basic table field

Re: Basket help
Posted: Sat Jun 18, 2016 7:07 pm
by AzTheBest
Klaus wrote:We might STILL take a look at your "additem" handler, as I already wrote!
BUT:
Code: Select all
dispatch "additem" "Chicken Steak","",5 to "table" of card "8" of stack "Restraunt Template"
1. You need to supply the TYPE of object that you are addressing:
... 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!
i didnt name the card as a number but they all called "Restraunt Template" then next to it has (1), (2) etc.
what im trying is to move information from the 1st stack by clicking button to stack 8 into my basic table field
Re: Basket help
Posted: Sat Jun 18, 2016 7:08 pm
by Klaus
I hate to repeat myself, but:
We might STILL take a look at your "additem" handler, as I already wrote!

Re: Basket help
Posted: Sat Jun 18, 2016 7:09 pm
by Klaus
AzTheBest wrote:i didnt name the card as a number but they all called "Restraunt Template" then next to it has (1), (2) etc.
So it is really card NUMBER 8 of that stack?
Then you do not need to use QUOTES!

Re: Basket help
Posted: Sat Jun 18, 2016 7:13 pm
by AzTheBest
Code: Select all
dispatch "additem" "Chicken Steak","",5 to "table" of card "8" of stack "Restraunt Template"
but where do i get rid of the quotes sorry for a pain

Re: Basket help
Posted: Sat Jun 18, 2016 7:16 pm
by Klaus
... of cd 8 of stack "xyz"
But that is surely not the problem, so we still need to look at your "additem" handler.
No idea if i already mentioned this.

Re: Basket help
Posted: Sat Jun 18, 2016 7:31 pm
by AzTheBest
would u recommend any other way

Re: Basket help
Posted: Sat Jun 18, 2016 7:38 pm
by Klaus
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"

Re: Basket help
Posted: Sat Jun 18, 2016 7:46 pm
by AzTheBest
Klaus 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"

okay i did that and it worked but then script of the handler "add item" showed up
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
and sorry was confused what u were asking but here it is
