> Anthony: I'd like a listof the uses of do. If there 
> are some good ones, maybe it'll be enough to justify

> the mess of using two interpreters...

Uli: Well, compatibility is pretty high on my list
here.

Alain: Check out the CGI script below. It allows this
ONE generic CGI to use a stack for each Web form. Each
form has different formElements, of course, but as
long as the target stack has the corresponding fields,
the formElementValues will be stored in the proper
fields of the stack. A simple web database solution
with a handful of handlers :) ... but it only works if
we have a DO cmd (e.g. runtime field-naming ).

on appleEvent class,event,sender
  if class is "WWW*" and event is "sdoc" then
    request appleEvent data with keyword "post"
    put parse(it) & return into formData
    set the itemDelim to "="
    put item 2 of line 1 of formData into targetStack
    go to stack targetStack
    saveFormData formData
    reply response()
  else
    pass appleEvent
  end if
end appleEvent

function parse postItems
  set the itemDelim to the numToChar of 38 --
ampersand
  repeat with x = 1 to the number of items of
postItems
    put item x of postItems into line x of postLines
  end repeat
  return postLines
end parse

function response
  -- returns response page in HTML
end response

on saveFormData formData
  go to last card
  doMenu "New Card"
  ----
  set the itemDelim to "="
  repeat with x = 1 to the number of lines of formData
    put item 1 of line x of formData into theField
    put item 2 of line x of formData into theValue
    --------------------------------------------------
    ------------- *** the DO command *** -------------
    --------------------------------------------------
    do "put" && theValue && "into field" && theField
    --------------------------------------------------
    --------------------------------------------------
  end repeat
end saveFormData
__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one place.
Yahoo! Shopping: http://shopping.yahoo.com

Reply via email to