DataSeries: copy, remove range, add range
Author: kribel
Creation Date: 8/15/2015 9:30 AM
profile picture

kribel

#1
Hi there!

I have got a few questions regarding DataSeries. Could you please help me to understand them?

1) Is it possible to create an exact copy of an existing DataSeries apart from looping though every entry and copying it by hand?
2) I came across the wording primary and secondary DataSeries. Where can I find more information on what this exactly means?
3) Is there a way remove a range of entries from a DataSeries without creating a new one and looping though it?
4) Is there a way to add a range of entries to an existing DataSeries without creating a new one and looping through it?

Many thanks!
profile picture

Eugene

#2
1) Like you do with any variable in C#. Really, it's that easy and universal.

2) WealthScript Programming Guide > DataSeries > Accessing Secondary Symbols, for example.

3, 4) Create a method (or extension method) that ultimately will be creating a new one and looping though it. Seriously, looping lies inside any syntax sugar like that.
profile picture

kribel

#3
Hi Eugene!

Many thank for your reply!

1) Do you mean ds2 = ds1? If I change ds2, will ds1 stay unchanged?

3, 4) I come from the embedded world. There are mechanisms to make the CPU do the job for you, which is a real runtime saver. But if this is not available it's O.K.
profile picture

Eugene

#4
Hi Konstantin,

1) It's very easy to check:

CODE:
Please log in to see this code.


3, 4) I'm not familiar with this field. In .NET, there are methods like .AddRange but one wasn't implemented for DataSeries.
profile picture

kribel

#5
Hi Eugene,

Great! That worked!

Many thanks for your help!
profile picture

kribel

#6
Last question to the = operator.

Is this what happens in the background?
CODE:
Please log in to see this code.