MC 7 and Global variables?

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

MC 7 and Global variables?

Postby arjfca » 08 Aug 2011

Hello

I got problem with my studies that use Global variables in MC7. I got a message like "Cant find "GV_SetnamedBool in dll"

All the code compile and functions did appeared in my function list

Any hints?

Martin

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Re: MC 7 and Global variables?

Postby SP » 08 Aug 2011

arjfca,

do you have the latest GV (version 2.2) installed ? (viewtopic.php?t=2483 ).

The problem is that with every update or new install MC overrides the GV dll with an older one (version 2).

@ Stan,
could that be fixed in one of the next versions.

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: MC 7 and Global variables?

Postby arjfca » 08 Aug 2011

OK
Do i overwrite the dll file or do I need to uninstall the older one?

Martin

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: MC 7 and Global variables?

Postby arjfca » 08 Aug 2011

This code does not work in MC 7

I did install GV version 2.2

Code: Select all

variables:
MyBigString( "" ) ;

If barnumber = 100 then
begin
Print ("My GV string is: ");
MyBigString = "Four score and seven years ago our fathers brought forth on this " + "continent, a new nation, conceived in Liberty, and dedicated to the " + "proposition that all men are created equal." ;

value1 = GVSetString( 3, MyBigString ) ;

Print( GVGetString( 3 ) ) ;
end;
GVGetString(3)) does not returned any value

Martin

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: MC 7 and Global variables?

Postby TJ » 08 Aug 2011

This code does not work in MC 7

I did install GV version 2.2

Code: Select all

variables:
MyBigString( "" ) ;

If barnumber = 100 then
begin
Print ("My GV string is: ");
MyBigString = "Four score and seven years ago our fathers brought forth on this " + "continent, a new nation, conceived in Liberty, and dedicated to the " + "proposition that all men are created equal." ;

value1 = GVSetString( 3, MyBigString ) ;

Print( GVGetString( 3 ) ) ;
end;
GVGetString(3)) does not returned any value

Martin
This will happen only if barnumber = 100 in real time.
Is that your intention?

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: MC 7 and Global variables?

Postby Dave Masalov » 08 Aug 2011

This will happen only if barnumber = 100 in real time.
Is that your intention?
Correct. GVSetString returns -1. The condition inside is: if LastBarOnChart then.
@ Stan,
could that be fixed in one of the next versions.
Thank you for your suggestion. It will be done in the next release.

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: MC 7 and Global variables?

Postby arjfca » 08 Aug 2011

This code does not work in MC 7

I did install GV version 2.2

Code: Select all

variables:
MyBigString( "" ) ;

If barnumber = 100 then
begin
Print ("My GV string is: ");
MyBigString = "Four score and seven years ago our fathers brought forth on this " + "continent, a new nation, conceived in Liberty, and dedicated to the " + "proposition that all men are created equal." ;

value1 = GVSetString( 3, MyBigString ) ;

Print( GVGetString( 3 ) ) ;
end;
GVGetString(3)) does not returned any value

Martin
This will happen only if barnumber = 100 in real time.
Is that your intention?
Thanks TJ

I'm just testing Global Variables with MC 7. This code as no other purpose

Martin

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: MC 7 and Global variables?

Postby arjfca » 08 Aug 2011

This will happen only if barnumber = 100 in real time.
Is that your intention?
Correct. GVSetString returns -1. The condition inside is: if LastBarOnChart then.
@ Stan,
could that be fixed in one of the next versions.
Thank you for your suggestion. It will be done in the next release.
Hello Dave

Should I understand that this is a confirmed error and problem will be resolved by the next release?

Martin

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: MC 7 and Global variables?

Postby Dave Masalov » 08 Aug 2011

Should I understand that this is a confirmed error and problem will be resolved by the next release?
Martin,

We will add version 2.2 of Global Variables dll to the next version. Regarding the issue that you are facing, GVSetString returns -1. The condition inside is: 'if LastBarOnChart then' which means that it will work only in real-time (it will happen only if barnumber = 100 in real time). If you want your code to work in real-time, you should change the code of GVSetString function, i.e. remove 'if LastBarOnChart then' condition.

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: MC 7 and Global variables?

Postby bowlesj3 » 09 Aug 2011

Hi,

Can I get a confirmation that GV 2.2 does in fact work in Win7. At least the Named GVs. I sure hope so!

Thanks
John

Regarding Martin's
Correct. GVSetString returns -1.
The documentation says "Named string global variables may contain strings of up to 250 characters." So this is probably what is creating the -1 error. That string is probably way larger than 250. The actual name of the GV variable for all named types is 100 long.


Regarding Boolean and numbered GVs, I personally have never used anything but the named (integers, floats and strings). For a switch I just use the Integer 0 or 1 so that if I decide to add more variants I can just go to 2,3,4 etc (you know, the maybe switch :-). The documentation says there are 3000 named (as opposed to numbered) variable locations of each data type. I am up to 982 Integers, 858 floats and 266 strings. So it appears I have only used 1/3 of the integer capacity. So what I am saying is you can create a very large number of integer flags and probably never run out. Right at the start when I read 3,000 I figured there is no point in using numbered because I probably will never need that many. However maybe someone is using GVs differently than I am so each to his own. I think some are storing actual bar data so there I can see the numbered GVs being useful. Maybe ADE uses the numbered GVs (not sure). So maybe it makes sense to reserve the numbered GVs only for storing actual bar data or something along that line like internal tables or whatever. Even with tables I have used the named string GVs and then just stuck a number on the end. Names are just so much easier to remember and 2 years after your programming is done if you have to make a change you will be cursing if you use numbers for every GV use (changes will take a lot longer).

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: MC 7 and Global variables?

Postby arjfca » 09 Aug 2011

Hello John
Hi,

Can I get a confirmation that GV 2.2 does in fact work in Win7. At least the Named GVs. I sure hope so!
Yes GV 2.2 did work in my system with Win7 64 & MultiCharts 7. I use the named GV to for the same reason. Same approach for the Boolean

This morning I had an error message about low memory. Not sure if it is not related. Any technical process I could use to determine a memory leakage?

Martin

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: MC 7 and Global variables?

Postby bowlesj3 » 09 Aug 2011

Thanks Martin. Glad to know the GVs are working on Win7. Yes it seems unlikely that MS would stop supporting it.
John.


Return to “MultiCharts”