Copyright 2008 Shoptalk Systems

LINK #handle, labelExpr$, handler

The LINK statement adds a link object (an HTML anchor) to the web page at the current position.  The link object is assigned to the variable named #handle.  The labelExpr$ is used to give the link a text label.  The handler is either the name of a branch label, or the name of a sub.

When the link  is clicked, the name of the handle variable is assigned to the global variable EventKey$.  If the handler is a named sub, then the name of the handler is passed into the sub as a string parameter.

Example:

  'add a link which will call a branch label
  link #one, "One", [oneClicked]
  print " ";
  'add a link which will call a scoped subroutine
  link #two, "Two", twoClicked
  print
  wait

[oneClicked]
  print "One was clicked!"
  print EventKey$
  wait

sub twoClicked handle$
  print "Two was clicked!"
  print handle$
  print EventKey$
end sub