SMath Studio Forum
»
SMath Studio
»
Questions
»
Modifying global variables in user defined function
Rank: Newbie
Groups: Registered
Joined: 01/07/2021(UTC) Posts: 2 Location: Yokohama
|
I am expecting the global variable value to change and maintain the change after exiting the function.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
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.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 01/07/2021(UTC) Posts: 2 Location: Yokohama
|
Hi Alvaro,
Thank you for your reply. How do I do that? Could you share some sample.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Native Smath has the exceptional feature of being algo style. You can do what you want from in-situ command line.
|
1 user thanked Jean Giraud for this useful post.
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Modifying global variables in user defined function
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.