include

include - include() function allow you to include simple definitions from other documents. - Messages

#41 Posted: 10/17/2014 11:49:23 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

I was thinking, it seems that it can be implemented for special cases. I'll try to add such possibility. But still, in general case, only Andrey can do it.

In private conversation, he did not approve of the idea to use the functions of the program for calculations in the background (as I do). In this case, you can use the modules of the program separately from the main program. I think it would violate the license agreement.
Russia ☭ forever, Viacheslav N. Mezentsev
#42 Posted: 10/18/2014 12:02:10 PM
brotjob

brotjob

7 likes in 71 posts.

Group: User

Why don't you just help Andrey to implement it the proper way? Doesn't he accept any help?
#43 Posted: 10/20/2014 10:48:23 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Updated. Added support for dynamic definitions. Experimental build.

Wrote

Why don't you just help Andrey to implement it the proper way? Doesn't he accept any help?


It's not so easy. I've no access to source code.

Quote

In cases where you have complex conditions and you want to define many variables in if statements it would not work. Also it does not work for loops for, while.


Try now.
Russia ☭ forever, Viacheslav N. Mezentsev
#44 Posted: 10/22/2014 4:10:18 AM
brotjob

brotjob

7 likes in 71 posts.

Group: User

Wrote

Updated. Added support for dynamic definitions. Experimental build.



Thank you!

Wrote

It's not so easy. I've no access to source code.



It is easy. He could send you the code in a simple email or give you access to some repository. It's a social issue.

Wrote

Quote

In cases where you have complex conditions and you want to define many variables in if statements it would not work. Also it does not work for loops for, while.


Try now.



I tried. It works if there are a few variables. But you have to open and close Smath Studio several times until you can access all the variables.

In my big file I have around 40 variables. It seems that I can access only the first ~15 of them irrespective of whether they are statically or dynamically defined.
#45 Posted: 10/22/2014 11:00:02 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Can I see the file? Or some example.

The current version does not support complex definitions that use functions from third-party plug-ins.
External dependences in the included file is not used.
Only Andrey knows how to include file correctly. This information is not documented.
Russia ☭ forever, Viacheslav N. Mezentsev
#46 Posted: 10/22/2014 2:36:47 PM
brotjob

brotjob

7 likes in 71 posts.

Group: User

actually I would prefer spending time with my son than debugging your code.

  1. open a new sheet, type a:=1
  2. save it as b.sm
  3. open another sheet, type include("b.sm" )
  4. save it as c.sm
  5. now include() should get a black frame but it remains framed red, error
  6. switch back to b.sm. Despite you have saved it and made no change, you will see an asterisk in the title bar which indicates a change. Save the file again
  7. Now switch back to c.sm and you should see a result.


This is time consuming and not logical.

Another example:

  1. Add another line b:=2 in b.sm
  2. change a to 0, save
  3. switch to c.sm. You will see the new value of a, but b will not be present
  4. in order to be able to use b in c.sm you need to switch back to b.sm and save it again.


If you have 40 variables you switch and save many many times...
#47 Posted: 10/23/2014 12:31:08 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

This is strange behavior. Your example works fine for me. Are you using the latest version (include - 0.1.5406.38586 and SMath Studio - 0.97.5346)?
Russia ☭ forever, Viacheslav N. Mezentsev
#48 Posted: 10/25/2014 12:13:44 PM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Quote

Despite you have saved it and made no change, you will see an asterisk in the title bar which indicates a change. Save the file again


I think this is a bug but not mine.
Russia ☭ forever, Viacheslav N. Mezentsev
#49 Posted: 10/27/2014 1:03:52 PM
brotjob

brotjob

7 likes in 71 posts.

Group: User

Filed in the bugtracker as Files are marked changed without change
1 users liked this post
Вячеслав Мезенцев 10/27/2014 1:05:00 PM
#50 Posted: 10/28/2014 3:57:52 AM
brotjob

brotjob

7 likes in 71 posts.

Group: User

I am finally able to create a minimal example that reproduces the bug, see attachment. Include() seems not to work with brackets.
include_bug.png
1 users liked this post
Вячеслав Мезенцев 10/28/2014 5:38:00 AM
#51 Posted: 10/28/2014 7:10:24 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Wrote

I am finally able to create a minimal example that reproduces the bug, see attachment. Include() seems not to work with brackets.



Updated. Bug fixed. Brackets now supported.

Russia ☭ forever, Viacheslav N. Mezentsev
1 users liked this post
Davide Carpi 10/28/2014 9:27:00 AM
#52 Posted: 10/28/2014 9:44:38 AM
brotjob

brotjob

7 likes in 71 posts.

Group: User

My big file works now! It found many more variables, all the ones that used brackets. However, when you divide a big file into several smaller files by copy-paste and include() the units get messed up. I filed the new bug units messed up during copy-paste.
1 users liked this post
Вячеслав Мезенцев 10/28/2014 2:03:00 PM
#53 Posted: 10/30/2014 4:24:48 AM
brotjob

brotjob

7 likes in 71 posts.

Group: User

I would like to use cascading dependencies. See the attached example. In file c.sm I cannot access all the variables I have in b.sm. Nevertheless I have the influence of a.sm in c.sm through the variable b. This is strange to me. Is it a wanted behavior? Why?

Of course I could include a.sm in c.sm again. But I could also include another file d.sm in c.sm which contains a:=2. I would then end up with a=2 and b=2 despite b being defined as 2*a...

I think there are two ways of implementing this properly:

  1. You can acess all the variables like a class. I.e c:=include( "a.sm" ) ... c.a=1
  2. Or the variables are universally accessible in all files directly, resulting in a=1 in c.sm

include_cascading.png
1 users liked this post
Вячеслав Мезенцев 10/30/2014 6:47:00 AM
#54 Posted: 10/30/2014 6:46:53 AM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

There is a log file in the folder with the plugin (it appears if the function doesn't work.). The function can't find the file in the specified path. As for the rest - it's strange behavior. I'll see what's wrong.
Russia ☭ forever, Viacheslav N. Mezentsev
#55 Posted: 10/30/2014 1:01:46 PM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Updated. Fixed bug with cascading dependencies.
Russia ☭ forever, Viacheslav N. Mezentsev
#56 Posted: 10/31/2014 12:26:18 PM
brotjob

brotjob

7 likes in 71 posts.

Group: User

Thanks, now it works in the manner that all variables are accessible in all the following sheets. It is slow however.
#57 Posted: 12/1/2014 7:36:15 AM

owndante

1 likes in 15 posts.

Group: User

It looks like there is a bug if you include Areas in the source file.
If your data is included in more than 2 Areas, the plugin will send only the content of the first one.
include.jpg
1 users liked this post
#58 Posted: 12/1/2014 1:26:53 PM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

I think this is not only my bug. I ask Andrey about it.
Russia ☭ forever, Viacheslav N. Mezentsev
#59 Posted: 12/7/2014 2:15:07 PM
Вячеслав Мезенцев

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

1402 likes in 1708 posts.

Group: Moderator

Wrote

It looks like there is a bug if you include Areas in the source file.
If your data is included in more than 2 Areas, the plugin will send only the content of the first one.


We found the problem. This issue is related to saving the file. Andrey will make the correction in the next build.

Russia ☭ forever, Viacheslav N. Mezentsev
#60 Posted: 12/16/2014 7:02:15 AM

owndante

1 likes in 15 posts.

Group: User

Hello!

It seems the includ does not send the result of a selected item (ex. Combobox, Radiobutton).

Regards,
Szabi
ComboboxIncludeTest.rar (14 KiB) downloaded 68 time(s).
  • New Posts New Posts
  • No New Posts No New Posts