Need help: Use of Globals in VB.Net  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Need help: Use of Globals in VB.Net

Postby Ram » 13 Dec 2014

following L Lewis' post http://www.multicharts.com/discussion/v ... 280#p97909 on how to use:
"A Native C# Solution for Global Storage"
I'm hitting a brick wall from the get go..

1. I imported Globals.pln into PLEditor (i get a red icon)
Image

2. I've added the deceleration:

Code: Select all

Public Shared NamedInteger As New ConcurrentDictionary(Of String, Integer)()
3. and then i tried to set a value to a key:

Code: Select all

Globals.NamedInteger("Length") = 4
and when compiling i get this error:
'Globals' is not declared. It may be inaccessible due to its protection level.
Any thoughts will be highly appreciated!!!
Thank you all in advance,
Best,
R.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Need help: Use of Globals in VB.Net

Postby Henry MultiСharts » 16 Dec 2014

Hello Ram,

Globals.pln utilizes a C# class. While your code is VB .NET. That is not possible to mix C# and VB .NET in the same study, that is why you cannot see the Globals function in the VB study.

There are two possible solutions:
1. Create a VB function that will do the required calculations.
2. In the zip file with Globals.pln there is a dll with the same code as the C# function has.
Therefore you can add a Reference to this dll and utilize it the same way you were going to use the function.

Ram
Posts: 90
Joined: 25 Nov 2014
Has thanked: 17 times
Been thanked: 5 times

Re: Need help: Use of Globals in VB.Net  [SOLVED]

Postby Ram » 16 Dec 2014

the Reference to the DLL fixed the problem!

Thx much!
Best,
R.


Return to “MultiCharts .NET”