Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


8 Pages<1234>»
Options
Go to last post Go to first unread
Offline sublim21  
#21 Posted : 29 November 2013 18:04:56(UTC)
sublim21


Rank: Advanced Member

Groups: Registered
Joined: 18/05/2011(UTC)
Posts: 36

Was thanked: 3 time(s) in 3 post(s)
Hey All,

Thanks for responding. I think i found the error.

The include function appears not to work, if the document it's running in is NOT SAVED.

once the document is saved, then the include extension works.

I'm going to keep playing with the include function (i've been waiting for smath to have this ability for a long long time).

Will report back with any errors.

Thanks!

-Pete
Offline uni  
#22 Posted : 30 November 2013 20:21:11(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated. Added support for strings. Error handling is changed.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 01/12/2013(UTC)
Offline mkraska  
#23 Posted : 01 December 2013 14:57:42(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Preliminary handbook pages:
File Attachment(s):
include.sm (29kb) downloaded 67 time(s).
include demo.sm (5kb) downloaded 64 time(s).
mkraska attached the following image(s):
include.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 2 users thanked mkraska for this useful post.
on 01/12/2013(UTC),  on 01/12/2013(UTC)
Offline sublim21  
#24 Posted : 24 January 2014 21:10:29(UTC)
sublim21


Rank: Advanced Member

Groups: Registered
Joined: 18/05/2011(UTC)
Posts: 36

Was thanked: 3 time(s) in 3 post(s)
There appears to be severe degradation on the time it takes to include a smath file, if that smath file contains a variable that is a string of length greater than 16.

Lets say I had two smath files as such

smathToInclude.sm
{
a:="some string of some length"
}

smathFile
{
include(smathToInclude.sm)
}

as the length of the string a increases so does the time it takes to include the file.

To test this, I created the following file.

smathFile
{
for b:=1 to 20 //do this 20 times to get a true sense of the include function time
c:=include(smathToInclude.sm)
}

And i changed the length of variable a to the following lengths, and got the following times

strlen TimeToInclude
10-.07
11-.07
12-.075
13-.085
14-.09
15-.095
16-.11
17-.169
20-.451
21-.74
22-1.16
23-1.851
24-2.841
25-4.519
30-49.0

It appears that string lengths above 16 chars is where the time to include shoots off the map - which makes me think the error has to be 16 bit representation.

Just letting you guys know,

-Pete
thanks 1 user thanked sublim21 for this useful post.
on 24/01/2014(UTC)
Offline uni  
#25 Posted : 24 January 2014 22:14:02(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Thank you, Pete. I'll check this.

This behavior may be due to using a regular expression search. I am using a string representation of expressions to make some changes. Search using regular expressions can lead to such delays. It will take time for profiling the code.
Russia ☭ forever
Viacheslav N. Mezentsev
Offline mkraska  
#26 Posted : 25 January 2014 15:48:58(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,985
Germany

Was thanked: 1124 time(s) in 721 post(s)
Files to be used by include() do not typically reside in the document directory where they are used but at some central repository in a given installation. Candidates for such repositories might be the extensions/snippets or extensions/example directories in the settings directory as found by SettingsDirectory().

How about adapted versions of include() either with a second argument or (more convenient in the dynamic assistant) a special name like include("name.sm","examples" ) or example("name.sm" ) or include_example("name.sm" ) or whatever seems to be convenient?

Then we could use the extensions manager for distribution and download of such files. Would also be nice to have a mechanism to include the complete contents of extensions/snippets or whatever dedicated directory by default (source lib plugin).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline wfoster982  
#27 Posted : 27 March 2014 12:22:48(UTC)
wfoster982

Rank: Newbie

Groups: Registered
Joined: 23/03/2014(UTC)
Posts: 1
United States
Location: Texas

I'm not sure if I am using "include" correctly.
But, when I include a file that has an expression with units, the defined object does not
manipulate the units correctly.
For instance -

LL.g=20*'lbf/{'ft^2}

LL.g*1/{25*'psf}=0.017*{'lbf*'m*'s^2}/{'ft^2*'kg}

When I multiply LLg times 1/25 psf; the result should be a unitless amount. It is coming up with
a mixed unit that cannot be manipulated or dealt with.

Can you help with this?

Great Program!!!


Offline uni  
#28 Posted : 27 March 2014 12:44:29(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: wfoster982 Go to Quoted Post
I'm not sure if I am using "include" correctly.
But, when I include a file that has an expression with units, the defined object does not
manipulate the units correctly.
For instance -

LL.g=20*'lbf/{'ft^2}

LL.g*1/{25*'psf}=0.017*{'lbf*'m*'s^2}/{'ft^2*'kg}

When I multiply LLg times 1/25 psf; the result should be a unitless amount. It is coming up with
a mixed unit that cannot be manipulated or dealt with.

Can you help with this?

Great Program!!!

Without using the include() function you get the same result?

EDIT: I have reproduced the problem. I can't advise something for now.

Edited by user 27 March 2014 12:56:45(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline uni  
#29 Posted : 27 March 2014 14:37:44(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated. Try this LL.g:eval(LL.g) before LL.g*1/{25*psf}.

Edited by user 27 March 2014 14:41:58(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline uni  
#30 Posted : 27 March 2014 17:54:50(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: mkraska Go to Quoted Post
Files to be used by include() do not typically reside in the document directory where they are used but at some central repository in a given installation. Candidates for such repositories might be the extensions/snippets or extensions/example directories in the settings directory as found by SettingsDirectory().

How about adapted versions of include() either with a second argument or (more convenient in the dynamic assistant) a special name like include("name.sm","examples" ) or example("name.sm" ) or include_example("name.sm" ) or whatever seems to be convenient?

Then we could use the extensions manager for distribution and download of such files. Would also be nice to have a mechanism to include the complete contents of extensions/snippets or whatever dedicated directory by default (source lib plugin).

Updated. Now file is searched for in two stages (if absolute path not used):
1. In the folder: /extensions/
2. In the document directory folder.

So, if you want to include some example sheet you need to use this: include( "examples\example1.sm" ) =

EDIT: Definitions in areas not supported.

Edited by user 27 March 2014 20:19:09(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 27/03/2014(UTC)
Offline uni  
#31 Posted : 25 April 2014 22:40:26(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated. Added support for names which start with ` symbol (Linq).
Russia ☭ forever
Viacheslav N. Mezentsev
Offline mikekaganski  
#32 Posted : 26 April 2014 00:43:28(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Originally Posted by: uni Go to Quoted Post
EDIT: Definitions in areas not supported.


Could you please address this limitation?

Thank you!
Best regards,
Mike Kaganski
Offline uni  
#33 Posted : 26 April 2014 00:58:04(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
I'll do that little later.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 26/04/2014(UTC)
Offline uni  
#34 Posted : 30 April 2014 19:21:05(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated. Definitions in areas now supported and function works faster.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 01/05/2014(UTC),  on 01/05/2014(UTC)
Offline PompelmoTell  
#35 Posted : 01 May 2014 12:40:09(UTC)
PompelmoTell


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2011(UTC)
Posts: 319
Man
Italy
Location: italy

Was thanked: 109 time(s) in 93 post(s)
"includes" do not work correctly if you use the comma for decimals and the "dot" to denote the subscript in the variables.
However I have seen in previous posts that Radovan had reported the problem to the name variables, and Martin has posted an example that uses a comma for decimals.
someone confirm?

sergio
thanks 1 user thanked PompelmoTell for this useful post.
on 01/05/2014(UTC)
Offline uni  
#36 Posted : 01 May 2014 17:29:45(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: PompelmoTell Go to Quoted Post
"includes" do not work correctly if you use the comma for decimals and the "dot" to denote the subscript in the variables.
However I have seen in previous posts that Radovan had reported the problem to the name variables, and Martin has posted an example that uses a comma for decimals.
someone confirm?

sergio

Updated. My fault. The algorithm was changed and I forgot about it.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 01/05/2014(UTC)
Offline uni  
#37 Posted : 23 June 2014 10:53:20(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated (for compatibility with SMath Studio 0.97.5283).

UnitInfo.GetCurrentUnitName() changed to UnitsManager.GetCurrentUnitName().
Russia ☭ forever
Viacheslav N. Mezentsev
Offline brotjob  
#38 Posted : 17 October 2014 11:04:31(UTC)
brotjob


Rank: Advanced Member

Groups: Registered
Joined: 18/09/2014(UTC)
Posts: 71
Switzerland

Was thanked: 7 time(s) in 7 post(s)
A lot of discussion has taken place here so I post my bug report here too. Or shall I use the bugtracker system instead?

Include does not work for variables defined in programming environment like if or for, see the example below, bread is not accessible in testmaster.sm
brotjob attached the following image(s):
include.png
Offline uni  
#39 Posted : 17 October 2014 11:39:18(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Quote:
Include does not work for variables defined in programming environment like if or for, see the example below, bread is not accessible in testmaster.sm

You can do this like on the picture below.

include() works with static global definitions (:=) only (static defs you can read directly from the sm-file, but for dynamic you must evaluate it first). I can't do that you want because this is too complicated. You may ask Andrey to add include() function in SMath Studio. He can do that.

Edited by user 17 October 2014 12:05:42(UTC)  | Reason: Not specified

uni attached the following image(s):
2014-10-17 14-36-06 Скриншот экрана.png
Russia ☭ forever
Viacheslav N. Mezentsev
Offline brotjob  
#40 Posted : 17 October 2014 17:18:25(UTC)
brotjob


Rank: Advanced Member

Groups: Registered
Joined: 18/09/2014(UTC)
Posts: 71
Switzerland

Was thanked: 7 time(s) in 7 post(s)
This is a very elegant way for the above example. Thanks for showing me this. 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. That's why I will ask Andrey to implement this.

see feature request To implement an include() function able to handle dynamic definitions. Please vote!

Edited by user 17 October 2014 20:35:33(UTC)  | Reason: +link to ticket

Users browsing this topic
Guest
Similar Topics
Display formula stored in "Included" SMath file (Questions)
by faruk 10/03/2024 23:36:28(UTC)
include files @ startup (Questions)
by charlamb 10/05/2023 23:44:05(UTC)
Adidas include guaranteed with the 12 months (Bugs & Problems)
by Guest 11/12/2020 07:02:55(UTC)
include function issues (Questions)
by jrufener 01/06/2019 21:44:47(UTC)
[include plugin] missing LinqBridge.dll error in SMath Viewer executables (Bugs & Problems)
by resist 24/11/2017 18:07:37(UTC)
Include [User Program Function] (Feature Requests)
by Jean Giraud 16/04/2016 15:29:14(UTC)
"include" plugin: default directory setting (Feature Requests)
by mikekaganski 04/04/2016 07:19:58(UTC)
Include and Combobox Region (Questions)
by RFreund 01/03/2016 02:18:21(UTC)
include does not seem to work anymore (Bugs & Problems)
by Tinu 23/06/2014 09:56:03(UTC)
Even so Kobe Shoes includes by no means offered " up " their particular method to Nike Air condition (Questions)
by gladys 07/06/2014 05:27:07(UTC)
Include Hook Sections (Feature Requests)
by sublim21 29/05/2013 21:23:33(UTC)
Include ksi and ksf in next release (Feature Requests)
by TheWizEd 17/07/2010 22:42:11(UTC)
Include function (Feature Requests)
by LordMike 24/10/2009 05:15:45(UTC)
8 Pages<1234>»
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.