Feature SS-1236
3 votes

To implement an include() function able to handle dynamic definitions

Created by brotjob on 10/17/2014 7:17 PM Last Updated by Mike Kaganski on 4/13/2016 3:33 AM
%
 (hrs)
Logged: 0   (hrs)

 Description

Currently include() is an extension by Viacheslav. It does not work if a variable is defined in a for or if environment. According to him it is not possible to include this feature in the extension. That's why I add this request to include it as a smath core feature.

Include is very useful when performing larger calculations. You can do simplified sheets for the sales department or give different permissions to the different files. If a sheet contains more than ~4 pages it's easy to loose overview. Include is a go-around. That's why we need a universal include function!

This topic was also discussed in the forum.

    Mike Kaganski (Wednesday, April 13, 2016 3:33 AM) #

I want to add, that such core include() would be even better if there would be accompanying feature to convert it to corresponding file's contents (e.g., a menu item in File menu like "Embed includes"). Embedded includes could be turned into collapsed areas with corresponding names.

Also, in SMath options, there should be a list of directories searched for includes, if file names are in relative form.

This would allow for using libraries in organisations, to allow for central management of reused blocks, and yet being able to create self-contained sheet in the end to pass to someone (e.g., to external party for check). We could create one or many places for includes and use only relative filenames where it's required to work in different environments: at work, there would be a network share with includes, while at home, I would create a directory on my PC with copies of includes. Paths would be different, and beinmg able to set include directories at program level could allow sheets to work in both environments.

 

Also note this message from include extension: built-in include should also import descriptions.