SMath Studio Forum
»
SMath Studio
»
Questions
»
Equivalent Programming Language
Rank: Member Groups: Registered
Joined: 07/01/2021(UTC) Posts: 27
|
Hi, What is the equivalent programming language in Smath vs MathCAD. I dont see RETURN, FOR with OTHERWISE and the local definition arrow. I must admit I am terrible in programming. Edited by user 23 January 2021 21:35:00(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Originally Posted by: davidlimtw Hi,
What is the equivalent programming language in Smath vs MathCAD. I dont see RETURN, FOR with OTHERWISE and the local definition arrow.
Hi. Return it's an unstructured instruction, which breaks the flow in a program. You don't have it in SMath, then you must to do a similar process like translate a BASIC program into pascal or c++. Otherwise is the else in SMath, which appear always as part of if instruction. That's a difference with Mathcad, where you can have an if without otherwise. In smath you can't have an if without the else clause. In your code also there are an inline if; smath don't have that option. Mathcad have origin=0, smath is origin=1. Finally, there are not any for with otherwise neither mathcad nor smath. In your code it could be confusing the use of if, but all of the otherwise are because one if, never because any for loop. This code could replicate the mathcad function, but because isn't clear where ends the for loop, I'm not sure if it is correct. You need to do some debug here. Notice also that mathcad can have for loops without "ending" or "close" with a result the line, but smath can't. Best regards. Alvaro.
|
1 user thanked Razonar for this useful post.
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: davidlimtw What is the equivalent programming language in Smath vs MathCAD Your first module, what does it do ?
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: davidlimtw I don't see RETURN, FOR with OTHERWISE and the local definition arrow. 1. "return" ... collected otherwise 2. "local definition" ... simply := 3. "if/else" within forloop ... YES Page5 Search.sm (25kb) downloaded 8 time(s).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: davidlimtw What is the equivalent programming language in Smath vs MathCAD The gigantic Smath repository Samples is essentially very many Mathcad documents re-coded Smath. A job of patience like in the attached recreating the two data sets involved. That particular one toke one day + ... so much rewarding. Not so easy on some documents that don't even work Mathcad ORIGIN 1 !!! I vaguely understand that your 3 modules are searching something within. Can you show more from your Mathcad result, some of us might help. Cheers ... Jean Utilities Lookup TREASURY_2 Locate Array1 Array2.sm (69kb) downloaded 14 time(s).
|
|
|
|
Rank: Member Groups: Registered
Joined: 07/01/2021(UTC) Posts: 27
|
Cheers Guys for the guidance and help.
I will give it a go and come back if I bump into any problems
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Equivalent Programming Language
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.