include

include - include() function allow you to include simple definitions from other documents. - Сообщения

#81 Опубликовано: 25.10.2015 14:29:44
Ryan Freund

Ryan Freund

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

Группа: User

@Jean

Цитата

In ~ 125000 exchanges Mathsoft Collaboratory I bet < 12 work sheets were exchanged with reference to other work sheet. It might be useful in Smath from prime consideration but in fact it is limited to specific functions, some type of program that would be cumbersome otherwise ... but the collapsed area is a much better approach as it keeps the document stand alone



Could you rephrase or elaborate on this. I'm curious to know what you mean here.
#82 Опубликовано: 13.01.2016 14:38:39
Ryan Freund

Ryan Freund

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

Группа: User

I'm trying to understand the "rules" of include.

Can the include function, include variables / functions from the following (my result in parenthesis):

1. Variables defined by a Combobox List (NO)
2. Variables defined within an area (Yes)
3. Variables defined in an area within an area (or within multiple areas) (NO)
4. Functions - Same rules as Variables
5. Variables defined by variables that are not transferable. Meaning that if you have X=2*Y and Y is inside of an area which is inside of another area then X will not be defined in you sheet which is trying to include the variable X. (NO)
6. Variables defined by functions that are not transferable. Meaning that if you have f(X,Y)=x*y this function is inside of an area which is inside of another area then any variables defined by the function f(X,Y) will not be defined in the sheet which is trying to include those variables. (NO)

In my opinion, I like this except for #1 (seems odd). This provides some control of variables. Additionally I think that all functions can be in their own areas, so they can be collapsed (ideally all functions would be located at the top of the page in each of their respective areas).

Thanks again for this Function!

Let me know your thoughts on updating the Combobox List.

#83 Опубликовано: 13.01.2016 23:22:56
Jean Giraud

Jean Giraud

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

Группа: User

@Jean

Quote:
In ~ 125000 exchanges Mathsoft Collaboratory I bet < 12 work sheets were exchanged with reference to other work sheet. It might be useful in Smath from prime consideration but in fact it is limited to specific functions, some type of program that would be cumbersome otherwise ... but the collapsed area is a much better approach as it keeps the document stand alone


Could you rephrase or elaborate on this. I'm curious to know what you mean here.

_______________________________________

include("string" ) - include sm-file .... as it looks: same as Mathcad/Mathsoft "reference"
i.e: reference to a work sheet that contains the program to be used elsewhere in any work sheet.

In all my visits to this forum, I have no recollection collabs posting a long valid work sheet
doing something useful in reference to a master "include'.

Mathcad/Mathsoft distributed many e-books, some with very few "reference"
One of them was so gigantic "Creating Amazing Images" that the bright Norvegian made it OTHERWISE

His 15 MB e-book is all in "globally defined mode". So, any specific work sheet [project] is also
globally defined ... works magic. Smath does not have the global definition. Sometimes I wish Smath
have global definition. So, you can define parameters at the point of use, past the function
definition. The way around is to include the parameters in the function definiion itself.
Having it: I would use occasionaly, I don't have: fine [not worth a cry].

You mention "Combobox". What could that be ? In 15 years of intensive forums [Process Control
and Instrumentation, Mathematica, Math forum, OriginLab, Mathsoft, now Smath] ... I don't even
imagine what "Combobox" would do for me because what that is ?

The Smath "compactor" enables to collect plotting arguments [I have not used more than 8]
The real limit ? Don't kow.

Using Smath correctly is the key. When you have problem: attach your work sheet,
Many collab will doctor your project. Your function f(x,y):= somtehing ... has no plotting interest
It must have parameters . Smath Maxima X_Y plot is gorgeous on that for plotting contours,
as many as you wish. This fall, I posted "Doublet" a great piece of work based on the "compactor".

What was your question/problem ?

An area within an area is like the pigeon pregant of the mouse, the mouse pregnant of the elephant.

Jean
#84 Опубликовано: 14.01.2016 00:35:32
Ryan Freund

Ryan Freund

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

Группа: User

@Jean -

First let me say, I love your enthusiasm and your metaphor/comparisons.
I will try to address some of your questions:
Combobox is a plugin which allows the use of a 'drop down' selection box inside the work sheet.

As far as using 'include' goes - I like the idea of connecting calculations that are part of a project. For example in one work sheet you define gravity loads in another you define lateral loads. Then you have a steel beam design file where you include the two 'load' files you previously created. This way if you change the loads, everything is 'automatically' updated.


I apologize for my poor use of an example function. I was just trying to demonstrate when 'include' actually includes something and when it does not. I will have to check out the Doublet.

So my question/problem is really just being able to use the combobox with the include function and trying to provide some information to others that are using include based on what I have found.

Thanks for the reply Jean
#85 Опубликовано: 02.02.2016 23:20:02
Ryan Freund

Ryan Freund

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

Группа: User

Uni - is it possible for include() to allow the use of the combobox region?

Thanks!
#86 Опубликовано: 03.02.2016 02:02:24
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Wrote

Uni - is it possible for include() to allow the use of the combobox region?


No, it is impossible. As I explained before, include() can use only static content (definitions), because it based on store.AddDefinition() method which can't load visual plugins. These data must be loaded by another way (Worksheet object). It is more complicated and Andrey can't do it now. In other words, for the full inclusion of other files need to significantly alter the function. And I'm not sure that I will succeed to do this.
Russia ☭ forever, Viacheslav N. Mezentsev
#87 Опубликовано: 04.02.2016 16:31:40
Ryan Freund

Ryan Freund

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

Группа: User

I see, thanks Uni. Maybe someday.
As you can see from some of the other threads I do think include() is very useful for any real project application.
#88 Опубликовано: 05.02.2016 02:50:43
Jean Giraud

Jean Giraud

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

Группа: User

Well ! pretty much left over "ComboBox".
On the place holder, I can plug the program bar, extend down
plug some functions f(x):= ln(x) ....
When getting out the CombBox: it crashes Smath ... repeatdidly.

Cheers, Jean
#89 Опубликовано: 05.02.2016 04:13:05
Jean Giraud

Jean Giraud

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

Группа: User

... "ComboBox" can't be be worst !
Open/Open/Open ... combo => crash/crash/crash.
What to do: nothing but go to hell and go to bed.

Jean
#90 Опубликовано: 05.02.2016 05:55:01
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Updated. Added support for nested areas.

Wrote

I'm trying to understand the "rules" of include.

Can the include function, include variables / functions from the following (my result in parenthesis):

1. Variables defined by a Combobox List (NO)
2. Variables defined within an area (Yes)
3. Variables defined in an area within an area (or within multiple areas) (NO)
4. Functions - Same rules as Variables
5. Variables defined by variables that are not transferable. Meaning that if you have X=2*Y and Y is inside of an area which is inside of another area then X will not be defined in you sheet which is trying to include the variable X. (NO)
6. Variables defined by functions that are not transferable. Meaning that if you have f(X,Y)=x*y this function is inside of an area which is inside of another area then any variables defined by the function f(X,Y) will not be defined in the sheet which is trying to include those variables. (NO)



Try now.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Davide Carpi 06.02.2016 08:23:00
#91 Опубликовано: 08.02.2016 08:49:03
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Updated. Now function can catch deep recursion. This feature is not fully tested.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Davide Carpi 08.02.2016 12:45:00
#92 Опубликовано: 14.04.2016 14:32:29
Arie

Arie

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

Группа: User

Is it possible for descriptions to be passed with include()?

See example

Untitled.png
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
1 пользователям понравился этот пост
Mike Kaganski 14.04.2016 23:47:00
#93 Опубликовано: 15.04.2016 02:07:43
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

No, now this is impossible. Function (AddDefinition() from SMath core lib ) which does the main job dosn't know about the description field for the definition. So I can't add this data.
Russia ☭ forever, Viacheslav N. Mezentsev
#94 Опубликовано: 15.04.2016 02:16:00
Jean Giraud

Jean Giraud

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

Группа: User

"include" has been discussed ad noseum. "Combox box" crashes Smath 5346.
Include" does not work either. What is "combobox " for ?

Let test you pretention outside of "combobox": download both work sheets.
The work sheet "Genfit Algo Include" is the progrmmed algorithm that
I would like to be live in the work sheet "Genfit Algo Include Test".

There is nothing to do, just wait until you get a plot [~ 1 second].
The error message says "file not found" ... "include" does not fetche
the algorithm computation from the referenced file, even if the referenced
algo is open in a separate Smath instance.

It would be useful to me, simplifying the data modeling.

Jean

Genfit Algo Include.sm (13 КиБ) скачан 97 раз(а).

Genfit Algo Include Test.sm (17 КиБ) скачан 90 раз(а).

#95 Опубликовано: 15.04.2016 02:53:27
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Try this Genfit Algo Include Test.pdf (33 КиБ) скачан 106 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
#96 Опубликовано: 15.04.2016 02:54:42
Mike Kaganski

Mike Kaganski

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

Группа: User

Wrote

Let test you pretention outside of "combobox": download both work sheets.
The work sheet "Genfit Algo Include" is the progrmmed algorithm that
I would like to be live in the work sheet "Genfit Algo Include Test".

There is nothing to do, just wait until you get a plot [~ 1 second].
The error message says "file not found" ... "include" does not fetche
the algorithm computation from the referenced file, even if the referenced
algo is open in a separate Smath instance.



Don't forget the file's extension: "path\to\file.sm"

Genfit Algo Include Test.sm (17 КиБ) скачан 101 раз(а).
С уважением, Михаил Каганский
#97 Опубликовано: 15.04.2016 09:35:35
Ruben Sidranski

Ruben Sidranski

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

Группа: User

Using Jean's files in the same directory, I updated to Mike's sheet and compared it to UNI's pdf ... I still have an error in the re-definition of BETA. Using latest SMath and plugins. BETA.PNG
#98 Опубликовано: 15.04.2016 13:35:38
Jean Giraud

Jean Giraud

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

Группа: User

Thanks Uni, Mike ... works fine. Press = after "Include" to activate.
Elid: try again

Jean
#99 Опубликовано: 15.04.2016 14:26:39
Ruben Sidranski

Ruben Sidranski

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

Группа: User

Jean,
I have the equal sign. It's in Mikes updated sheet. The Beta in the screen shot I took shows 4; whereas Uni's PDF shows a 4x1 matrix (array)
#100 Опубликовано: 15.04.2016 17:45:23
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Jean,
I have the equal sign.It's in Mikes updated sheet.The Beta in the screen shot I took shows 4; whereas Uni's PDF shows a 4x1 matrix (array)

.

You may have to put both work sheets in your Smath working directory.
If you read 4, instead of 1: it does not find the work sheet in question.
If it does not work: the problem is specific to your instalation.
After the wife and the kids, consider re-installing Smath.

Jean

  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений