Path: utzoo!mnetor!uunet!husc6!bbn!rochester!ur-tut!aisl From: aisl@ur-tut.UUCP (Larry Landry) Newsgroups: comp.sys.mac.hypercard Subject: Re: Are computed 'answer's possible? Message-ID: <819@ur-tut.UUCP> Date: 14 Jan 88 21:52:40 GMT References: <2582@sfsup.UUCP> Reply-To: aisl@tut.cc.rochester.edu.UUCP (Larry Landry) Organization: Univ. of Rochester Computing Center Lines: 36 In article <2582@sfsup.UUCP> shap@sfsup.UUCP (J.S.Shapiro) writes: >I have a hack for which I would like to use a computed 'answer'. >That is, I want to determine what the options given in the 'answer' >command are by some calculations rather than by stating them >a priori. > >Jon HyperTalk allows you to generate a script in a variable and then execute that script. The following code will execute an answer with variable options. on varAnswer count, question, reply1, reply2, reply3 -- the answer command with varible number of commands -- pass three replys and reduce count if you don't want all to appear -- build the command put "answer" && quote & question & quote into myCommand if count > 0 then put " with " & quote & reply1 & quote after myCommand if count > 1 then put " with " & quote & reply1 & quote after myCommand if count > 2 then put " with " & quote & reply1 & quote after myCommand end if end if end if do myCommand end varAnswer Simply modify this to your application. Larry Landry