[comp.sys.mac] WingZ Hyperscript

bannon@andromeda.rutgers.edu.rutgers.edu (Ronald Bannon) (07/19/89)

Hello,

            I'm having trouble with WingZ hyperscript functions.
            The first piece of code is a function which is called 
            from cell A1 with "=MyFunctions:Times_table(5)" but 
            this causes the WingZ program to quit. The other piece
            of code is not a function but does the exact same thing
            and it runs perfectly. Any suggestions?

*****************************************************************************
  function Times_table (size)
    define i
    for i = 1 to size
      put i into "r" & 1 & "c" & i + 1
      put i into "r" & i + 1 & "c" & 1
    end for
    put "= B$1 * $A2" into B2
    select range "r2c2" & ".." & "r" & size + 1 & "c" & size + 1
    copy right
    copy down
  end function
*****************************************************************************

            The above function causes WingZ to quit with error
            28 (ELSE without IF), however the below script runs 
            perfectly and is essentially the same except it is
            not a function.

******************************************************************************
  define size
  size = 5
  define i
  for i = 1 to size
    put i into "r" & 1 & "c" & i + 1
    put i into "r" & i + 1 & "c" & 1
  end for
  put "= B$1 * $A2" into B2
  select range "r2c2" & ".." & "r" & size + 1 & "c" & size + 1
  copy right
  copy down
******************************************************************************

            I still have not been able to find a good book on
            Hyperscript for WingZ and have resorted to experimentation.
            Hopefully a good book will be published soon on programming
            WingZ but until then I think I will do a minimum amount
            of programming in Hyperscript.  


Thanks,
Ron Bannon
bannon@andromeda.rutgers.edu (email)