How to alg.Print to the log file all of a cBot's source when it contains statements containing {0}

Created at 08 Apr 2020, 00:53
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
MA

martins

Joined 22.10.2019

How to alg.Print to the log file all of a cBot's source when it contains statements containing {0}
08 Apr 2020, 00:53


Trying to log all lines of a source file as a record for possible later comparison of what changed, to an own file via WriteLine (works) and also to the built in log via alg.Print, but the latter crashes if the source line is a Print or WriteLine statement of a string containing "...{0}...", because the logging Print statement tries to substitute for curly bracket {0} whereas, since it's just a literal source line, substitution is not required and a value doesn't exist.  Currently this means I can't copy the source to the builtin log, only to my DIY WriteFile logging.

Is there a way of calling Print without it trying to substitute values for certain embedded substrings such as {0}?


@martins
Replies

Shares4us
30 Apr 2020, 18:41

RE:

 

// something like :

text = "I contain a {0} pattern";
Print( text, "{0}" );

But better get professional cTrader developer (will save you a lot of frustration and money if you go live)


@Shares4us