|
Post by knoware on Jan 25, 2008 15:39:05 GMT -5
There is probably a very simple answer to this, but how do you pass a value using the link command??
|
|
|
Post by Alyce on Jan 25, 2008 15:57:22 GMT -5
There is probably a very simple answer to this, but how do you pass a value using the link command?? Not sure what you want. There's a "setkey()" method. #handle SETKEY(stringExpr$) - Set the link's event key to stringExpr$ If this isn't helpful, can you describe your problem in more detail?
|
|
|
Post by mikeukmid on Jan 25, 2008 16:00:01 GMT -5
|
|
|
Post by knoware on Jan 25, 2008 16:11:48 GMT -5
Hmmm! Maybe I'm not understanding how to do this.!! I have a list if items displayed on the screen in a table. About 20 items per page and each has an item number and description and other stuff. Each item has a link to [Add], [Chg], [Del] and a couple others. Depending on what row you click the link, I need to pass that information. So for example if you click the [Del] link next to item number 20, I need to pass item number 20 back.
I tried several things but I must have the wrong syntax. How exactly do I do it???
Thanks for the help..
|
|
|
Post by mikeukmid on Jan 25, 2008 16:34:58 GMT -5
Does this snippet of code help?
link #del,"[del]",delIt #del setkey(20)
wait
sub delIt key print key 'code to delete entry end sub
|
|
|
Post by StefanPendl on Jan 26, 2008 5:46:04 GMT -5
|
|
|
Post by Jerry Muelver on Jan 26, 2008 7:14:50 GMT -5
You can use one sub to handle variable link values: [tryagain] link #one, "One", linker #one setkey("One") html " " link #two, "Two", linker #two setkey("Two") html " " link #quit, "Quit", linker #quit setkey("All done!") print wait
sub linker key$ print key$ if key$ = "#quit" then end end sub
I'd have three handler subs, one for each common link -- Add, Change, Del. Then get the rowIndex, convert it to a string, put it in setKey. In Del, you pick up the key$, convert back to an integer, and feed it into your Delete row command. Same basic approach in the Add and Change subs.
|
|
|
Post by Alyce on Jan 26, 2008 8:01:31 GMT -5
Hmmm! Maybe I'm not understanding how to do this.!! I have a list if items displayed on the screen in a table. About 20 items per page and each has an item number and description and other stuff. Each item has a link to [Add], [Chg], [Del] and a couple others. Depending on what row you click the link, I need to pass that information. So for example if you click the [Del] link next to item number 20, I need to pass item number 20 back. I tried several things but I must have the wrong syntax. How exactly do I do it??? Thanks for the help. You say the list is in a table. Are you creating the table with HTML? If you are creating the table with a Run BASIC "Table" statement, only one column in the table can contain links. The RowID mentioned in other responses is valid for RB Table elements, but not for elements in a table you format yourself with HTML. If you are using a "Table" statement, there's a RowID example here: runbasic.wikispaces.com/Table#tocTable8I asked for the RowID during beta testing and I find it to be very handy... thanks, Carl! If you are creating the table yourself with HTML and making multiple elements in a "row" into links, the SETKEY() mentioned in some responses will help. Can you please post some code? It's nearly impossible to help, otherwise.
|
|
|
Post by turbov21 on Jan 30, 2008 11:05:05 GMT -5
Borrowing from Jerry's lead... How about this? global x$ Dim x$(3) x$(0) = "Andy" x$(1) = "Roxy" x$(2) = "Kerovia" x$(3) = "Aglaope"
[start] Call Main
Sub Main cnt = 0
html "<table style=""border: 1px solid; padding: 2px;""><tbody>"
for y = 0 to 1 html "<tr>" for z = 0 to 1 html "<td style=""border: 1px solid; mardin: 2px; padding: 2px;"">" link #link, x$(cnt), ShowName #link setkey(x$(cnt)) html "</td>" cnt = cnt + 1 next z html "</tr>" next y
html "</tbody></table>" wait End Sub
Sub ShowName nam$ cls print nam$ Call Main End Sub
|
|