Go Stack
J. Landman Gay
jacque at hyperactivesw.com
Wed Mar 20 00:17:01 EST 2002
I wrote:
>
> I think I went astray
> because I've done the stack-on-the-web thing in HC and I was looking for
> similar behavior in MC, but I guess it isn't going to work.
Whoa. I accidentally did it -- it does work. :) Very cool. I didn't have
all the pieces together exactly right at any given time before.
It looks like every reference to an object has to be a long reference. I
was incorrectly using short references before. Anyway, I ended up with this:
on startup
put $QUERY_STRING into theTerm
put "" into buffer
if theTerm = "" then
put "No query submitted." after buffer
else
start using "mystack.mc"
repeat with x = 1 to the number of cds of stack "mystack"
get fld "title" of cd x of stack "mystack"
if it contains theTerm
then put it &" - " & fld "author" of cd x \
of stack "mystack" & cr after buffer
end repeat
stop using "mystack.mc"
end if
if buffer = "" then put "No titles found." into buffer
put "Content-Type: text/plain" & cr
put "Content-Length:" && the length of buffer & cr & cr
put buffer
end startup
So you have to loop through everything, checking each field and card,
one at a time. The stack is fairly small so it doesn't take too long.
Now I have to add in looping through all the fields, but now that the
foundation is there that shouldn't be too hard.
Thanks guys.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the metacard
mailing list