Re: ti89: questions
[Prev][Next][Index][Thread]
Re: ti89: questions
Tom Lake wrote:
>
> Laurent Deniau <Laurent.Deniau@cern.ch> wrote in message
> 36FF4BEC.9B8BA71F@cern.ch">news:36FF4BEC.9B8BA71F@cern.ch...
> > Sorry, but I can't find out the answers to these questions in the
> manual...
> >
> > 1) How do you modify and/or return a local variable or parameter of a
> > sub-program (I don't want to use a global variable) ?
> >
> > printstr()
> > Prgm
> > Local getname, name
> > Define getname(name)=Prgm
> > Request "file name",name
> > Return name (Meaningless for program)
> > EndPrgm
> > getname()->name (Forbidden for programs)
> > EndPrgm
>
> You can't use name as both a parameter and a local variable. If you want to
> pass name to the sub, use it in the parentheses as above. Local variables
> can't be modified permanently. They cease to exist after the program ends.
>
> Tom Lake
> ICQ #25589135
I know what is a local variable... My question is:
How do I return a value from a program ? I can't use a function since I
need to get the value from the user (needs I/O) and the TI basic doesn't
authorise to do I/O inside functions (strange limitation). I can't use
program since I need to return a value. For common language, you can either
modify a parameter or return a value (Basic) or both (Pascal, C). This is
essential for the completeness of the language !
The limitation of I/O inside functions forbids the second case. Then I need
a way to solve the first case. Then again:
How do you modify a parameter of a program ?
Thanks,
Laurent.
--
[ Deniau Laurent -- Numerical Analysis and Signal Processing ]
[ CERN -- The European Laboratory for Particle Physics ]
[ Laurent.Deniau@cern.ch -- http://home.cern.ch/~ldeniau ]
[ -- One becomes old when dreams become regrets -- ]
******************************************************************
* To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
* with a message (not the subject) that reads SIGNOFF CALC-TI
*
* Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
******************************************************************
References: