include

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

#1 Опубликовано: 09.11.2013 23:10:55
Вячеслав Мезенцев

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

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

Группа: Moderator

include

SMath Studio compatibility SMath Viewer compatibility mono compatibility Extension page Sources


Functions: include(1).

You can include sm-file containing a simple set of definitions.

How to use: include("myfile.sm" )=

Note. The dependencies of the include file may differ from the current set of plugins or have different versions. In this case, you need to check that the included file is calculated correctly.
2014-11-01 12-29-40 SMath Studio Desktop.png
Russia ☭ forever, Viacheslav N. Mezentsev
5 пользователям понравился этот пост
ioan92 10.11.2013 17:33:00, Andrey Ivashov 10.11.2013 18:05:00, Davide Carpi 10.11.2013 06:04:00, Martin Kraska 10.11.2013 11:34:00, IVR 10.11.2013 12:16:00
#2 Опубликовано: 10.11.2013 03:40:45
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Thank you uni

I was just playing bit with include(). I just figured out that the hoovering over the include there will be presented the alphabetical order of variables, the variables with dot in its name will be ignored. As I could understand only the assignment of variables will work - but not always (complicated structures will be ignored). Now, there is a bit of problem to kepp the track about which variables have been defined with include(). Maybe a list of them to be available?

Regards,
Radovan

EDIT: Hmm...uni posted this a minute before I posted this one. I will check function definitions - it did not work for me.
EDIT1: It is working regarding functions, but the dot in the names is still ignored. Variables are not now in the alphabetical order
include2.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Опубликовано: 10.11.2013 03:48:48
Вячеслав Мезенцев

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

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

Группа: Moderator

I'll fix this later.

P.S. I'll remove preprocessing too.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Radovan Omorjan 10.11.2013 03:55:00
#4 Опубликовано: 10.11.2013 04:12:38
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated. Try now.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Radovan Omorjan 10.11.2013 05:34:00
#5 Опубликовано: 10.11.2013 05:33:38
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wrote

Updated. Try now.


Yes, it seems ok now. Dot is working inside a variable name.
Thank you.

Regards,
Radovan

EDIT: Suppose that units are not handled yet
EDIT1: Yes, units are handled now .
include-units.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#6 Опубликовано: 10.11.2013 10:01:31
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated. Try now.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Radovan Omorjan 10.11.2013 12:42:00
#7 Опубликовано: 10.11.2013 11:40:46
Martin Kraska

Martin Kraska

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

Группа: Moderator

uni, Davide,

Could the include() function possibly be combined with the hyperlink region, such that the link points to the sm file to be included (opens in a new window)? One could think of a special region with the option to choose the link target...

Of course, this would just be nice to have, not worth distracting you from more important stuff.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#8 Опубликовано: 10.11.2013 11:57:01
Вячеслав Мезенцев

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

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

Группа: Moderator

I think David can do it, combining both our source code. Something like the Reference in Mathcad.
Russia ☭ forever, Viacheslav N. Mezentsev
#9 Опубликовано: 10.11.2013 12:46:24
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Wrote

Updated. Try now.


Thank you. It seems I am just just few moments ahead before you fix all these things.
I will just wait and stop bothering you about it for a while

Regards,
Radovan


When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#10 Опубликовано: 10.11.2013 13:56:00
Davide Carpi

Davide Carpi

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

Группа: Moderator

Nice work Viacheslav

Wrote

uni, Davide,

Could the include() function possibly be combined with the hyperlink region, such that the link points to the sm file to be included (opens in a new window)? One could think of a special region with the option to choose the link target...

Of course, this would just be nice to have, not worth distracting you from more important stuff.



Wrote

I think David can do it, combining both our source code. Something like the Reference in Mathcad.



I think that a new region derived from our codes should be the way; as additional thing the "maple" region could give an additional contribute (region without input placeholder)


BTW actually I'm exploring an unexplored corner of SMATH's API
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#11 Опубликовано: 10.11.2013 18:01:17
Andrey Ivashov

Andrey Ivashov

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

Группа: Super Administrator

Wrote

BTW actually I'm exploring an unexplored corner of SMATH's API


I'm thrilled!

P.S.: Uni, bravo!
1 пользователям понравился этот пост
Davide Carpi 11.11.2013 07:19:00
#12 Опубликовано: 10.11.2013 18:49:23
Davide Carpi

Davide Carpi

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

Группа: Moderator


tern.gif
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 пользователям понравился этот пост
Andrey Ivashov 12.11.2013 18:45:00, Martin Kraska 10.11.2013 21:26:00
#13 Опубликовано: 10.11.2013 21:25:49
Martin Kraska

Martin Kraska

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

Группа: Moderator

Davide, that is simply great! Does that mean that you can define arbitrary operator formats?

Then here is my wish-list
- cases (like sys, just with 2 columns, first value, second condition)
- at (vertical bar with subscript for the location)
- vec (boldfacing and non-scalar-declaration)

Can you make symbolic and numeric evaluation look differently?

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#14 Опубликовано: 11.11.2013 07:17:56
Davide Carpi

Davide Carpi

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

Группа: Moderator

Wrote

Davide, that is simply great! Does that mean that you can define arbitrary operator formats?

Then here is my wish-list
- cases (like sys, just with 2 columns, first value, second condition)
- at (vertical bar with subscript for the location)
- vec (boldfacing and non-scalar-declaration)

Can you make symbolic and numeric evaluation look differently?


Andrey's magic interfaces

As for now the first is in my plans and is possible to do; the 2nd and the 3rd are interesting but (as first impression) are closest to low-level operators than to functions, so I'm not sure that is possible to have something usable... Are just thoughts, maybe is possible, as usual step-by-step we will discover what we can do...
2013-11-11 15_29_12-SMath Studio Desktop - [SF.sm].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#15 Опубликовано: 26.11.2013 14:22:55
sublim21

sublim21

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

Группа: User

Awesome! i was waiting for something like this to come along. Much appreciated!

the only problem is, i went to your svn link, and... i was confused on what to download/what to do, to add your 'include' extension into my portable version of smath. Can someone please explain what I'm supposed to do to have access to this incredibly nice extension?

Thanks,

-Pete

*edit - i found this link of plugins and extensions with the include plugin listed.
http://smath.info/?extensions=SMathStudio_Desktop

is this the latest version? cause everytime i try to run it, i get an error - Object Reference not set an instance of an object.

I inserted the dll file located above in the plugin folder of my portable smath folder. still getting the same error
#16 Опубликовано: 26.11.2013 16:50:32
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

Awesome! i was waiting for something like this to come along. Much appreciated!

the only problem is, i went to your svn link, and... i was confused on what to download/what to do, to add your 'include' extension into my portable version of smath. Can someone please explain what I'm supposed to do to have access to this incredibly nice extension?

Thanks,

-Pete

*edit - i found this link of plugins and extensions with the include plugin listed.
http://smath.info/?extensions=SMathStudio_Desktop

is this the latest version? cause everytime i try to run it, i get an error - Object Reference not set an instance of an object.

I inserted the dll file located above in the plugin folder of my portable smath folder. still getting the same error



You can use the inofficial portable distribution, the plugin is included there, see link in my signature.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#17 Опубликовано: 27.11.2013 14:34:09
sublim21

sublim21

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

Группа: User

Wrote



You can use the inofficial portable distribution, the plugin is included there, see link in my signature.



Thanks for providing that portable version Mkraska.

Unfortunately, i'm still getting the same error. I just tested your portable on two seperate windows 7 installations, with the following.

a test.sm file was created and saved in the portable directory with only the following declaration:

testy:5

Then, i tried 'including' this test.sm in another smath page with

include( "test.sm" ) =
(spaces are included in the above to avoid the emoticons!)
and i'm still getting the object reference error.

I tried moving the test.sm file to another location "I:\test.sm" and still was getting the same errors on both machines.

Any ideas?

-Pete
#18 Опубликовано: 27.11.2013 18:10:26
Martin Kraska

Martin Kraska

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

Группа: Moderator

I get the object reference error message if the specified file name to include is wrong. File names without path are relative to the directory of the given document. Thus, make sure both docs are in the same directory if there is no path specified.
Otherwise you have to specify the full absolute path or a path relative to your current document's directory.

PS: uni, would be nice if there was a more specific error message like "file not found" including info on where the file is expected to be (path)
SMath and the OS.sm (25 КиБ) скачан 144 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#19 Опубликовано: 28.11.2013 11:29:33
Вячеслав Мезенцев

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

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

Группа: Moderator

Show me log.txt from the plugin directory.

Цитата

PS: uni, would be nice if there was a more specific error message like "file not found" including info on where the file is expected to be (path)



This message should be displayed if the file is not found (from source code where FileName - full path):

if ( !File.Exists( FileName ) ) throw new Exception( "File not found: " + FileName );
Unfortunately, I do not understand where it disappears.

Object reference error - this is normal situation, but these errors must be hidden. You can see them in log.txt. The latest version for now is 1.0.5062.35981.
Russia ☭ forever, Viacheslav N. Mezentsev
#20 Опубликовано: 28.11.2013 13:12:08
Martin Kraska

Martin Kraska

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

Группа: Moderator

This is the log contents, if I open caller.sm with a valid include statement and then mess up the file name a little in order to test what happens if I try to include a non-existing file.

Цитата

28.11.2013 18:05:11 [INFO ] [Plugin.Initialize()] include(1) - include sm-file.
28.11.2013 18:05:11 [INFO ] [Plugin.Initialize()] Successfully. 1 functions loaded.
28.11.2013 18:05:56 [ERROR] Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
28.11.2013 18:06:01 [ERROR] [Plugin.ExpressionEvaluation()] include(1) File not found: D:\FHB\Software\SMath\SMath Skript\SMath\Include\efs.sm
28.11.2013 18:06:01 [ERROR] [Plugin.ExpressionEvaluation()] include(1) File not found: D:\FHB\Software\SMath\SMath Skript\SMath\Include\efs.sm



defs.sm (2 КиБ) скачан 139 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений