Resolve:Using FileAppend
Posted: Dec 17 2013
I just resolve the question
I found that I could add "NewLine" to each string before using the function FileAppend
This add a carriage return and the file is properly formatted
_____________________________________________________________________
Hello
This is a complementary question to this post
viewtopic.php?f=1&t=45869
I just found that I could use the function FileAppend to write string to a file. Work fine, but how to I separate each lines? The end result look like this
Martin
I found that I could add "NewLine" to each string before using the function FileAppend
This add a carriage return and the file is properly formatted
_____________________________________________________________________
Hello
This is a complementary question to this post
viewtopic.php?f=1&t=45869
I just found that I could use the function FileAppend to write string to a file. Work fine, but how to I separate each lines? The end result look like this
It should be like this37,1.35371,1.35371,42000.0000000000,90500.0000000000,2124031,1,False,False138,1.37932,1.37932,
230000.0000000000,230000.0000000000,35723,1,False,False3,1.37889,1.37759,73000.0000000000,81500.0000000000,
2124031,1,False,False4,1.37127,1.37127,10000.0000000000,10000.0000000000,2124031,1,False,True
My code:37,1.35371,1.35371,42000.0000000000,90500.0000000000,2124031,1,False,False
138,1.37932,1.37932,230000.0000000000,230000.0000000000,35723,1,False,False
3,1.37889,1.37759,73000.0000000000,81500.0000000000,2124031,1,False,False
4,1.37127,1.37127,10000.0000000000,10000.0000000000,2124031,1,False,True
Code: Select all
//Capture the Trendline characteristics and store them in global variable
Var:
FileName("G:\ExcelMUlticharts\Database\TrendLine"),
ListID (0),
return_Val (0),
Comma (","),
GVCount (0),
TL_count (0),
TL_Num (0),
TL_Num_Ex (0),
TL_First (0),
TL_Last (0),
List_String (""),
TL_Num_String (""),
TL_Price_S (""),
TL_Price_E (""),
TL_Time_S (""),
TL_Time_E (""),
TL_Color (""),
Tl_Style (""),
TL_Ext_L (""),
TL_Ext_R ("");
Const:
DrawManually (7);
Once begin
FileName= FileName +"_" + GetSymbolName + ".txt";
//ListID = ListS.Share("TrendLinesInfo");
FileDelete(Filename);
//Return_Val = Lists.WriteFile(ListID, FileName); //erase
GVSetNamedString("TrendLineFile",FileName);
TL_First = TL_GetFirst(DrawManually );
Tl_Num = TL_First;
TL_Num_Ex = 0;
While TL_Num <> -2 begin
TL_Num_Ex = TL_NUM;
TL_Count = TL_Count +1;
TL_Num_String = NumToStr(TL_Num,0);
TL_Price_S = NumtoStr(TL_GetBeginVal(TL_Num),5);
TL_Price_E = NumToStr(TL_GetEndVal(TL_Num),5);
TL_Time_S = NumToStr(TL_GetBeginTime_s(TL_Num),10);
TL_Time_E = NumToStr(TL_GetEndTime_s(Tl_Num),10);
TL_Color = NumToStr(TL_GetColor(TL_Num),0);
TL_Style = NumToStr(TL_GetStyle(TL_NUM),0);
IF tl_getextleft(TL_Num) then TL_Ext_L = "True" else TL_Ext_L = "False";
IF tl_getextRight(TL_Num) then TL_Ext_R = "True" else TL_Ext_R = "False";
List_String = TL_Num_String + comma + TL_Price_S + comma + TL_Price_E + comma + TL_Time_S + comma + TL_Time_e + comma + TL_Color + comma + TL_Style + comma + TL_Ext_L + comma +TL_Ext_R;
//Print (ListID, " ", list_String);
FileAppend(Filename,List_String);
TL_NUm = TL_GetNext(tl_num,DrawManually);
//Print("TL_Num: ", TL_Num:0:0);
end;
TL_Last = TL_Num;
end;