如何在TI-89中返回函数的值?

Cha*_*han 3 calculator ti-basic

这是我计算两个数字a和gcd的函数b.当我使用Prgm和EndPrgm时,它工作正常.但是,它在创建函数时不断弹出一条错误消息"功能或当前表达式无效":(.有什么想法吗?

gcd(a, b )
Func 
 If a>b Then
  a->t
  b->a
  t->b
 EndIf

 While b#0
  a->t
  b->a
  mod(t, b)->b 
 EndWhile
 Return a
EndFunc
Run Code Online (Sandbox Code Playgroud)

Cha*_*han 8

我通过创建参数的本地副本来解决它:

Local x, y  
a->x  
b->y  
Run Code Online (Sandbox Code Playgroud)