Print true false  [SOLVED]

Questions about MultiCharts and user contributed studies.
waldem
Posts: 115
Joined: 18 Nov 2013
Has thanked: 3 times
Been thanked: 4 times

Print true false

Postby waldem » 04 Oct 2016

Hi all, i know perfectly the NumtoStr, but i forgot the equivalent to print true/false.
could you help me?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Print true false

Postby TJ » 04 Oct 2016

Hi all, i know perfectly the NumtoStr, but i forgot the equivalent to print true/false.
could you help me?

Please explain.

waldem
Posts: 115
Joined: 18 Nov 2013
Has thanked: 3 times
Been thanked: 4 times

Re: Print true false

Postby waldem » 04 Oct 2016

Hy Tj,
i mean that normally i use Expert commentary to print my variables like:
Str=Str+" My_Var: "+NumToStr(My_Var,6)+NewLine;

i know that is possible instead of NumToStr to plot variable True/False but i forgot the command to put it in a string.

thanks

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Print true false

Postby TJ » 07 Oct 2016

Hy Tj,
i mean that normally i use Expert commentary to print my variables like:
Str=Str+" My_Var: "+NumToStr(My_Var,6)+NewLine;

i know that is possible instead of NumToStr to plot variable True/False but i forgot the command to put it in a string.

thanks

What is "plot variable True/False" ?

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Print true false  [SOLVED]

Postby ABC » 13 Oct 2016

Hi waldem,

there is no equivalent like "TrueFalseToStr", but you can easiliy write a function with a string as return value and one input of type "truefalsesimple". Then you pass your boolean, evaluate if it's true or false and return the appropriate string that you want to see in either case. Then you can simply call the function in your print statements.

Besides that you can of course simply print the boolean.
The code

Code: Select all

Print("True = ", true, "; false = ", false ) ;
returns the following output:

Code: Select all

True = TRUE; false = FALSE
so there might not even be a need for a conversion.

Regards,

ABC
Hi all, i know perfectly the NumtoStr, but i forgot the equivalent to print true/false.
could you help me?


Return to “MultiCharts”