Find a symbol across DataSets
Author: Sammy_G
Creation Date: 6/4/2010 3:58 PM
profile picture

Sammy_G

#1
The Data Manager in WLPro v5.6, as in v4.5, lacks the Find function which one would use to locate all occurrences of a symbol in all datasets. Is there a plan to introduce it in a future release? Or is there perhaps a script based solution someone may have developed?
profile picture

Cone

#2
In general, there's no plan to add anything that you can do yourself in a script ;)

CODE:
Please log in to see this code.
profile picture

Sammy_G

#3
Thanks for the fast reply, Cone; it works great! But you have to click on a symbol first. Would you happen to have a version that would pop up with a window or something that prompt you to input the symbol(s)?
profile picture

Eugene

#4
You could use the Input method from Community.Components to pop up a window.
profile picture

Sammy_G

#5
Can you point me to a script that uses it so I can understand its usage?
profile picture

Eugene

#6
Sure, it's the method's description page in the Wealth-Lab Wiki.
profile picture

Sammy_G

#7
OK, will check it out.
profile picture

Sammy_G

#8
Came up with this:
CODE:
Please log in to see this code.

But the results are unreliable, and if the input box is left blank WLPro crashes. Can you fix this?
profile picture

Cone

#9
CODE:
Please log in to see this code.
profile picture

Sammy_G

#10
Still doesn't work right. There's something deeper wrong within the code.
profile picture

Eugene

#11
Neither it crashes for me on any version with blank symbol nor demonstrates unreliable results.

To eliminate any guesswork, what are the symbols with their DataSet names you're having problem with?
profile picture

Sammy_G

#12
Here's the code I'm checking:
CODE:
Please log in to see this code.

I don't know if I changed something, but now it doesn't even popup with an input box either when I click on a symbol or hit the F5 key. Also, when I hit Compile, I get this message in the lower window:
error CS0428 @ (20, 15) : Cannot convert method group 'ToUpper' to non-delegate type 'string'. Did you intend to invoke the method?
profile picture

Eugene

#13
QUOTE:
Also, when I hit Compile, I get this message in the lower window:

Synthax error, check Cone's syntax carefully.
profile picture

Sammy_G

#14
Oh, what a bummer! Got it, fixed it, thanks.

Just one more thing: If I want the input box to remain open for inputting a 2nd or 3rd or 4th etc symbol what should I do? In other words, the box should remain open until I close it w/o typing anything.
profile picture

Eugene

#15
CODE:
Please log in to see this code.
profile picture

Eugene

#16
P.S. Just enter your symbols all at once, separating them with space, comma or ";"
profile picture

Sammy_G

#17
Thanks, Eugene, works great! Only thing is I like to look at symbols' locations one below the other - meaning, all locations for 1 symbol listed first, then locations for symbol 2 listed next, and so on. If you get some time, please try to modify the code to do that.
profile picture

Eugene

#18
Sorry, no - as you understand, I have no time for endless code modifications as it will almost certainly make me sacrifice the other work.

Cone and yours truly have provided you with an example, please feel free to modify it and discover C# along the way.
profile picture

Sammy_G

#19
Hey guys, why don't you post this script as a utility script under Community downloads. Everybody needs to find a symbol now and then.
profile picture

Eugene

#20
Thank you for the suggestion, I'll mark it for later.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).