Please find below my code and log for loading an array, writing it to a file and reading it back (no problem) UNTIL I try resize the array to add another row to store more data. [...]
If you declare or resize an array so that it has 2 elements (e.g. ArrayResize(arr, 2)) then those elements are 0 and 1, not 1 and 2.
As far as I can see you are resizing the array from 1 and 2, and then trying to write data into arr[2] when only arr[0] and arr[1] are valid.
Please find below my code and log for loading an array, writing it to a file and reading it back (no problem) UNTIL I try resize the array to add another row to store more data.
I get no errors but data entered from an order into the array is not there when I try to read it back again. HELP!!! been trying to fix it for over a week now so bound to be something I do not
understand or/and I am being really stupid.
If you have 1 row the first row number is 0 not 1 . . .
If you declare or resize an array so that it has 2 elements (e.g. ArrayResize(arr, 2)) then those elements are 0 and 1, not 1 and 2.
As far as I can see you are resizing the array from 1 and 2, and then trying to write data into arr[2] when only arr[0] and arr[1] are valid.
Thanks please see my final post on this subject.
Read the documentation . . . FileDelete() string filename
If you have 1 row the first row number is 0 not 1 . . .
Thanks please see my final post on this subject
Thanks to the contributors gchrmt4: and RaptorUK:
There are two basic errors in each of 3 code lines
MyArray[Row,1] = MyTicket;
MyArray[Row,2] = Ask;
MyArray[Row,3] = Bid;
Should be
MyArray[OldRow,0] = MyTicket;
MyArray[OldRow,1] = Ask;
MyArray[OldRow,2] = Bid;
Thanks again Guys
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Please find below my code and log for loading an array, writing it to a file and reading it back (no problem) UNTIL I try resize the array to add another row to store more data.
I get no errors but data entered from an order into the array is not there when I try to read it back again. HELP!!! been trying to fix it for over a week now so bound to be something I do not
understand or/and I am being really stupid.