Rank: Advanced Member Groups: Registered
Joined: 30/08/2009(UTC) Posts: 52 Location: Australia
|
Not to sure how it is coded, but would it be possible to explicitly state the output variable within a function. For instance func( a,b):=some complicated stuff which ends up in M M= Edited by moderator 21 September 2009 05:05:39(UTC)
| Reason: Smile removed
|
|
|
|
Rank: Administration Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member Joined: 11/07/2008(UTC) Posts: 1,616 Was thanked: 1978 time(s) in 666 post(s)
|
Not sure I understand. Please, post detailed explanation, maybe I'll implement it.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 30/08/2009(UTC) Posts: 52 Location: Australia
|
http://smath.info/wiki/G...unday_insert_problem.zipfor example. The procedure to insert a row works, but the function doesn't because you can't explixitly return the answer. Something like ans:=B would be the way i'd expect to do it, where ans is a reserved word like in Matlab
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Greg Locock wrote:http://smath.info/wiki/GetFile.aspx?File=gregpics%5csunday_insert_problem.zip
for example. The procedure to insert a row works, but the function doesn't because you can't explixitly return the answer.
Something like ans:=B would be the way i'd expect to do it, where ans is a reserved word like in Matlab
This is, actually, the possibility to make Mathcad-like multiline functions with "line" (extension of SMath programing capability). It is on my "wishlist" as well. I really do not have the slightest idea how complicated could that be to implement in SMath, considering differences between SMath and Mathcad. As far as I know (hope I am right) the only way to define a function in more then one line (just visually) is with "if": func(x)←if(x≤5;5;x)func(2)=5 func(10)=10Regards, Radovan Edited by user 21 September 2009 18:23:37(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 30/08/2009(UTC) Posts: 52 Location: Australia
|
other syntax suggestions, these would go as the last line in a multiline function I don't really have a preference, although B= is probably a bit weird. Edited by user 21 September 2009 18:43:02(UTC)
| Reason: smiley
|
|
|
|
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.