Post
Topic
Board Project Development
Re: Qt Bitcoin Trader [Open Source secure trading client for Mac/Windows/Linux]
by
IGHOR
on 20/09/2017, 17:26:12 UTC
Hello,

Yes I tried that and it didn't work to split with space charecter. Will try again.

thank you
Damjan

You need to split with endline character .split("\n")

Hi Ighor,

I tried that also with code below:
Code:
var variablePath = "D:\\";
var logFile = variablePath + "config.txt";
var string = trader.fileReadAll(logFile);
var array = string.split("\n");

trader.log("1.:" + array[0]);
trader.log("2.:" + array[1]);
trader.log("3.:" + array[2]);
trader.log("4.:" + array[3]);

and as result I get

Code:
19:15:51> 1.:#comment value1=25.0 #comment value2=25.5 value3=25.6
19:15:51> 2.:undefined
19:15:51> 3.:undefined
19:15:51> 4.:undefined

I have uploaded config file to cloud server https://ufile.io/jv2ni

Thank you
Damjan

Try to add ';' at end of each line and use ';' as split value.
It more JavaScript question than Qt, so better ask JavaScript experts.