SMath论坛 SMath Studio Questions Modifying global variables in user defined function 1页(5条) Modifying global variables in user defined function - I am trying to modify a global variable inside a function passed as an argument. - 消息 转到最后一个帖子 #1 已发布: 2021/6/30 22:28:24 stephen16 0个赞,共2个帖子。 组: User I am expecting the global variable value to change and maintain the change after exiting the function. #2 已发布: 2021/6/30 23:49:39 Alvaro 1,139个赞,共1,805个帖子。 组: User Hi. The only way I know for a function to modify a variable is to pass it by reference to the function.Best regards.Alvaro. #3 已发布: 2021/7/1 00:03:51 stephen16 0个赞,共2个帖子。 组: User Hi Alvaro,Thank you for your reply. How do I do that? Could you share some sample. #4 已发布: 2021/7/1 00:12:28 Alvaro 1,139个赞,共1,805个帖子。 组: User Hi.example_by_ref.sm (4.86 KiB)已下载 1260 次。Best regards.Alvaro. #5 已发布: 2021/7/1 08:35:00 Jean Giraud 983个赞,共6,866个帖子。 组: User Native Smath has the exceptional feature of being algo style.You can do what you want from in-situ command line. 1位用户喜欢此帖子Oscar Campo 2021/7/1 10:50:00 1页(5条) 有新帖 无新帖