Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline davidlimtw  
#1 Posted : 23 January 2021 18:13:01(UTC)
davidlimtw


Rank: Member

Groups: Registered
Joined: 07/01/2021(UTC)
Posts: 27
Man
United Kingdom

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.

Capture12.jpg

Edited by user 23 January 2021 21:35:00(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Razonar  
#2 Posted : 23 January 2021 23:18:19(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: davidlimtw Go to Quoted Post
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.

Clipboard02.jpg

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 23/01/2021(UTC)
Offline Jean Giraud  
#3 Posted : 24 January 2021 01:22:41(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: davidlimtw Go to Quoted Post
What is the equivalent programming language in Smath vs MathCAD

Your first module, what does it do ?

Search.PNG
Offline Jean Giraud  
#4 Posted : 24 January 2021 01:43:56(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: davidlimtw Go to Quoted Post
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).

Offline Jean Giraud  
#5 Posted : 24 January 2021 15:14:17(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: davidlimtw Go to Quoted Post
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).
Offline davidlimtw  
#6 Posted : 24 January 2021 20:30:35(UTC)
davidlimtw


Rank: Member

Groups: Registered
Joined: 07/01/2021(UTC)
Posts: 27
Man
United Kingdom

Cheers Guys for the guidance and help.

I will give it a go and come back if I bump into any problems
Users browsing this topic
Guest
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.