include

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

#41 Опубликовано: 17.10.2014 11:49:23
Вячеслав Мезенцев

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

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

Группа: 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 Опубликовано: 18.10.2014 12:02:10
brotjob

brotjob

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

Группа: User

Why don't you just help Andrey to implement it the proper way? Doesn't he accept any help?
#43 Опубликовано: 20.10.2014 10:48:23
Вячеслав Мезенцев

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

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

Группа: 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.

Цитата

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 Опубликовано: 22.10.2014 04:10:18
brotjob

brotjob

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

Группа: 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

Цитата

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 Опубликовано: 22.10.2014 11:00:02
Вячеслав Мезенцев

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

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

Группа: 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 Опубликовано: 22.10.2014 14:36:47
brotjob

brotjob

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

Группа: 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 Опубликовано: 23.10.2014 00:31:08
Вячеслав Мезенцев

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

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

Группа: 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 Опубликовано: 25.10.2014 12:13:44
Вячеслав Мезенцев

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

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

Группа: Moderator

Цитата

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 Опубликовано: 27.10.2014 13:03:52
brotjob

brotjob

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

Группа: User

Filed in the bugtracker as Files are marked changed without change
1 пользователям понравился этот пост
#50 Опубликовано: 28.10.2014 03:57:52
brotjob

brotjob

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

Группа: 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 пользователям понравился этот пост
#51 Опубликовано: 28.10.2014 07:10:24
Вячеслав Мезенцев

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

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

Группа: 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 пользователям понравился этот пост
Davide Carpi 28.10.2014 09:27:00
#52 Опубликовано: 28.10.2014 09:44:38
brotjob

brotjob

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

Группа: 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 пользователям понравился этот пост
#53 Опубликовано: 30.10.2014 04:24:48
brotjob

brotjob

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

Группа: 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 пользователям понравился этот пост
#54 Опубликовано: 30.10.2014 06:46:53
Вячеслав Мезенцев

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

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

Группа: 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 Опубликовано: 30.10.2014 13:01:46
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated. Fixed bug with cascading dependencies.
Russia ☭ forever, Viacheslav N. Mezentsev
#56 Опубликовано: 31.10.2014 12:26:18
brotjob

brotjob

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

Группа: User

Thanks, now it works in the manner that all variables are accessible in all the following sheets. It is slow however.
#57 Опубликовано: 01.12.2014 07:36:15

owndante

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

Группа: 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 пользователям понравился этот пост
#58 Опубликовано: 01.12.2014 13:26:53
Вячеслав Мезенцев

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

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

Группа: Moderator

I think this is not only my bug. I ask Andrey about it.
Russia ☭ forever, Viacheslav N. Mezentsev
#59 Опубликовано: 07.12.2014 14:15:07
Вячеслав Мезенцев

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

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

Группа: 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 Опубликовано: 16.12.2014 07:02:15

owndante

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

Группа: User

Hello!

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

Regards,
Szabi
ComboboxIncludeTest.rar (14 КиБ) скачан 69 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений