Equivalent Programming Language

Equivalent Programming Language - Сообщения

#1 Опубликовано: 23.01.2021 12:13:01
Tow Wai Lim

Tow Wai Lim

0 сообщений из 42 понравились пользователям.

Группа: User

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
#2 Опубликовано: 23.01.2021 17:18:19
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Wrote

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.
1 пользователям понравился этот пост
sergio 23.01.2021 17:26:00
#3 Опубликовано: 23.01.2021 19:22:41
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

What is the equivalent programming language in Smath vs MathCAD


Your first module, what does it do ?

Search.PNG
#4 Опубликовано: 23.01.2021 19:43:56
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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 (24 КиБ) скачан 24 раз(а).

#5 Опубликовано: 24.01.2021 09:14:17
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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 (68 КиБ) скачан 34 раз(а).
#6 Опубликовано: 24.01.2021 14:30:35
Tow Wai Lim

Tow Wai Lim

0 сообщений из 42 понравились пользователям.

Группа: User

Cheers Guys for the guidance and help.

I will give it a go and come back if I bump into any problems
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений