Script Error - Cannot use path on Integer! object

Started by RonG on 14-Mar-2012/22:52:33-7:00
factor: func [ arg1 [integer!]] [ x: 1 while [ arg1 > 1 ] [ x: x * arg1 arg1: arg1 - 1 ] return x ] This works in the REBOL interpreter but not in my embedded RPN calculator script.
It looks the problem is somewhere else. Could you provide the rest of the script? One little note: Your function changes the x in global scope (it may be used somewhere else and leads to the problem you have) No need for Return. This will be a bit better: factor: func [arg1 [integer!] /local x] [ x: 1 while [ arg1 > 1 ] [ arg1: arg1 - 1 x: x * arg1 ] ]

Reply