[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: STREXTRACT only works on comma separated lists??



PureBytes Links

Trading Reference Links

> I'm definitely not saying this is the best way to do this

What do you think would be the best way to do this, in an array processing language designed to anlayse time based price series?


(theoretically speaking).

--- In amibroker@xxxxxxxxxxxxxxx, "tuzo_wilson" <j.tuzo.wilson@xxx> wrote:
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Conrad Joach" <consolejoker@>
> wrote:
> >
> > I have strings that are delimited by multiple char types. For instance
> I have arrays within arrays like so:
> >
> > field1,field2,field3,field4|field1,field2,field3,field4
> >
> > It would be nice if STREXTRACT would work like most modern versions of
> this type of string manipulation function and accept as an argument any
> arbitrary character.
> 
> I'm definitely not saying this is the best way to do this, but another
> option at your disposal is to enable script and use the split method of
> JScript:
> 
> 
> 
> EnableScript("JScript");
> 
> 
> 
> record = "1,2,3,14|15,6,7,28|29";
> 
> 
> 
> <%
> 
> var tempArr =  AFL.Var("record").split(',');
> 
> var splitArray = new Array();
> 
> 
> 
> for ( var i = 0, len = tempArr.length; i < len; i++ )
> 
> {
> 
>      // If the array value contains a pipe then re-split into a separate
> array
> 
>      // otherwise add to the "regular" array
> 
>      if (tempArr[i].indexOf('|') != -1)
> 
>      {
> 
>          AFL("splitArray" + i) = tempArr[i].split('|');
> 
>      }
> 
>      else
> 
>      {
> 
>          splitArray.push(tempArr[i]);
> 
>      }
> 
> }
> 
> 
> 
> AFL("splitArray") = splitArray;
> 
> %>
> 
> 
> 
> // Plots 1,2,3,6,7
> 
> Plot(splitArray,"SplitArray", colorBlue,styleLine);
> 
> 
> 
> // Plots 14,15
> 
> Plot(VarGet("splitArray3"),"SplitArray3", colorGreen,styleLine);
> 
> 
> 
> // Plots 28,29
> 
> Plot(VarGet("splitArray6"),"SplitArray6", colorRed,styleLine);
> 
> 
> 
> 
> 
> 
> Tuzo
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/