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

Re: [amibroker] Substuting ";" with "," in a TWS trade file



PureBytes Links

Trading Reference Links

Herman,

You may find this executes faster (Possibly Much).
Past it into an indicator to see how it works.

_SECTION_BEGIN("Split");
// Split & Assign Data to Static Variables.
DataString = "This;is;a;test";
SL = 1;DataFields = ""; Loc = 0;
StrL = StrLen(DataString);
for (FL = 0; FL < StrL-1; FL++)
    {
     Loc = StrFind(DataString,";");
    if (Loc != 0)
        {
        StaticVarSetText( "Field"+SL,StrLeft(DataString,Loc-1));
        RNum = StrLen(DataString) - Loc;
        DataString = StrRight(DataString,RNum);
        SL++; FL = FL + Loc-1;
        }
    else
        {
        FL = StrL;
        }
    }
StaticVarSetText( "Field"+SL,DataString);


// Display Split fields in Static Variables as one string.
for (FL=1; FL < SL+1; FL++)
{
GetField = "Field"+FL;
Data = "    [" + (FL) + "]" + StaticVarGet(GetField);
DataFields  = DataFields + Data;
}

Title = DataFields ;
_SECTION_END();


------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

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

<*> 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/