PureBytes Links
Trading Reference Links
|
Thanks for that info, Bill. I will try it. (What do you mean "it can
cause errors at times." ?)
There is a slightly less convoluted way of doing what I was doing.
Instead of the (Spaces(5 - StrLen(NumtoStr(Close,2)) + ...
you can determine the number of positions in the variable (Close)
and set a variable which is used in the Spaces(num) . However, this
can be messy too:
Var: Cls_Spc(0);
IF Close >= 100 Then Cls_Spc = 1 {add 1 space}
Else if Close >= 10 Then Cls_Spc = 2 {add 2 space}
Else Cls_Spc = 3 {assume Close < 10 } {add 3 space}
FileAppend(c:\... , NewLine
+ Spaces(Cls_Spc) + ....
The file append statement is neater :-) It's probably faster, too.
don
William Brower wrote:
>
> Unfortuantely, you have revealed one of the more annoying limitations of the
> FileAppend command. You can use the undocumented TEXT command which allows
> you to specify decimals both right and left but it can cause errors at times.
>
> FileAppend( "C:\filename", TEXT( C:3:2, nextval:3:2, ...)+newline);
>
> At 05:39 PM 10/27/98 -0800, you wrote:
> >I use FileAppend a lot. The TS 4 feature is clumsy, though, since it
> >does not include automatic spacing as with the print log. At least I
> >don't think it does. I have been doing the following to get columns to
> >line up vertically in the file output:
> >
> >FileAppend(c:\ ..... , NewLine
> > + NumtoStr(Date,0) + " "
> > + Spaces(5 - StrLen(NumtoStr(Close,2))) + NumtoStr(Close,2)
> > + Spaces(5 - StrLen(<next_value> ,2))) + NumtoStr(Close,2)
> > + Spaces(5 - StrLen(<next_value> ,2))) + NumtoStr(Close,2)
> >
> >The theory is to compute the spaces needed to pad a field from the
> >next field based on the number of characters in the field.
> >But first you convert the field to a string. Then you print the value,
> >AFTER converting it to a string (again).
> >
> >Is this more work than necessary ?
> >
> >don
> >
> >
> >
>
> William Brower
> Publisher of TS Express
> Email: 1000mileman@xxxxxxxxxxxxxx
> Web: http://www.insideedgesystems.com
|