2 Dimension FileReadArray() Error 4053
I found the solution, see below:
#property copyright "FutureRobot" #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { write(); read(); } void write() { int arr[2][2]; arr[0][0]=123; arr[0][1]=213; arr[1][0]=2132; arr[1][1]=153; string FileName = "test2"; FileDelete(FileName); int fileOpenStatus = FileOpen(FileName,FILE_WRITE|FILE_BIN); FileWriteArray(fileOpenStatus,arr); FileClose(fileOpenStatus); } void read() { int arrs[][2]; string FileName = "test2"; int fileOpenStatus = FileOpen(FileName,FILE_READ|FILE_BIN); uint w = FileReadArray(fileOpenStatus,arrs); int aa = (ArraySize(arrs)/2)-1; int r = ArrayResize(arrs,aa+1); uint ww = FileReadArray(fileOpenStatus,arrs); int gg = GetLastError(); int a = (ArraySize(arrs)/2)-1; int b,c; for(int i=0;i<=a;i++) { b=arrs[i][0]; c=arrs[i][1]; } FileClose(fileOpenStatus); }
Discover new MetaTrader 5 opportunities with MQL5 community and services
- www.mql5.com
Ask questions on technical analysis, discuss trading systems and improve your MQL5 programming skills to develop your own trading strategies. Communicate and share your experience with traders from anywhere in the world, answer questions and help beginners — MQL5.community is developing along with you. Signal not public anymore Hi there, for...
Hi All,
I have small issue with 2 dimenstion array. First I write array to .txt file and next i would like to read array to my array variables. Then occurs error 4053 "ERR_SOME_ARRAY_ERROR".
Could you help me? Please see below example script code for mql4: