Export a matrix object to a binary file without header. Data in the matrix will be written out in exact same way as internal storage of row-major order
int okoc_binary_mat_export( LPCSTR lpcszRangeMat, LPCSTR lpcszPath, LPCSTR lpcszExt, string * pstrActualFilename, LPCSTR lpcszFilenamePrefix = NULL )
0 if no error, otherwise <0 error codes
EX1
#include <okocUtils.h> //make sure there is an active matrixsheet with data in it. void okoc_binary_mat_export_ex1() { MatrixLayer ml = Project.ActiveLayer(); if ( ml ) { MatrixObject mo(ml, 0); string strRange; if ( mo.GetRangeString(strRange) ) { string strFile = "XX.b2d"; int nErr = okoc_binary_mat_export(strRange, GetAppPath(true), "txt", &strFile, "MTX_"); if ( nErr == 0 ) printf("File %s save successfully.\n", strFile); } } }
okoc_mat_binary_import
okocUtils.h