Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!bcm!dimacs.rutgers.edu!seismo!uunet!wuarchive!usc!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!uxh.cso.uiuc.edu!rlarson2 From: rlarson2@uxh.cso.uiuc.edu (Robert S larson) Newsgroups: comp.os.msdos.apps Subject: Re: 123 Getlabel macro question Message-ID: <1991Feb28.205028.6093@ux1.cso.uiuc.edu> Date: 28 Feb 91 20:50:28 GMT References: <23056@hydra.gatech.EDU> Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 45 ccastdf@prism.gatech.EDU (Dave) writes: > I want to use the GETLABEL and GETNUMBER macro commands to issue a >variable prompt and perform input. The example below is a macro subroutine >INPSUB for input, which uses the contents of PROMPT as a prompt string, and >returns the user input in CURINPUT. > >Defined Ranges -------------PROMPT CURINPUT NAME ADDR > >Macro Steps ----------- > : > {let PROMPT,"Enter your name: "} > {INPSUB} > {let NAME,CURINPUT} > {let PROMPT,"Enter your address: "} > {INPSUB} > {let ADDR,CURINPUT} > : > >{INPSUB} {getlabel PROMPT,CURINPUT} > return > > This seems to work in V2.2, but not V2.01. Should this work in V2.01? In V2.01 the first argument of {GETLABEL } can only be a string -- whereas in V2.2 it can be a string, a string formula, or a range. A method which works in both versions and only requires one additional line is to include a macro step which alters the {GETLABEL }. Just change your sub-routine {INPSUB} to this: {INPSUB} {let INPSUB2, +"{getlabel "&@char(34)&prompt&@char(34)&",curinpt":v} {INPSUB2} this cell is created by the cell above it, it is the getlabel comm {return} The macro at cell {inpusub} not creates the proper {getlabel } in the cell just below it -- which is now named INPSUB2. The purpose of the @char(34) in the string formula is to put the proper "" in the prompt s D C cell just below it, which is now called {INPSUB@} {return}