Hi fxsaber. Firstly, thank you for the work on TypeToBytes. I downloaded both the TypeToBytes file and mq5 example, and on running it, I get a handful of errors all related to cast problems. Here are a few examples of the errors;
cannot cast 'MqlTick' to 'STRUCT_READ<MqlTick>'TypeToBytes.mqh11520
cannot cast 'STRUCT_READ<MqlTick>' to 'STRUCT_TYPE<MqlTick>'TypeToBytes.mqh844
cannot cast 'STRUCT_READ<double>' to 'STRUCT_TYPE<double>'TypeToBytes.mqh6214
cannot cast 'STRUCT_READ<uchar>' to 'STRUCT_TYPE<uchar>'TypeToBytes.mqh6214
cannot cast 'STRUCT_READ<MqlTick>' to 'STRUCT_TYPE<MqlTick>'TypeToBytes.mqh854
I am trying to use this file as part of a neural network I am developing. Your help is greatly appreciated.
// String extractionint ArrayINT[];
string ArraySTR[] = {"123", "456", "789"};
_ArrayCopy(ArrayINT, ArraySTR); // Copy ArraySTR array to ArrayINT array byte by by byte
ArrayPrint(_R(ArrayINT).Bytes); // Look at the bytes of the received arraystring ArraySTR2[];
_ArrayCopy(ArraySTR2, ArrayINT); // Copy ArrayINT array to ArraySTR2 array byte by by byte
ArrayPrint(ArraySTR2); // Print the received array
PRINT(_R(ArraySTR) == ArraySTR2) // Make sure that ArraySTR == ArraySTR2
PRINT(_R(ArrayINT)[(string)1]) // Retrieve the string from ArrayINT starting from byte 1 - "23"
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
TypeToBytes:
Author: fxsaber
Hi fxsaber. Firstly, thank you for the work on TypeToBytes. I downloaded both the TypeToBytes file and mq5 example, and on running it, I get a handful of errors all related to cast problems. Here are a few examples of the errors;
I am trying to use this file as part of a neural network I am developing. Your help is greatly appreciated.
The latest version is always here.
That did it, thanks a million for your hard work and swift response too.
Great job, thank you all guys.
Example of use
Forum on trading, automated trading systems and testing trading strategies
Struct Casting Error
fxsaber, 2017.05.12 12:17
Windows username, bit rate, number of cores, memory size, etc. are available.
Get sensitive data of cloud agent owners
Windows username, bit rate, number of cores, memory size, etc. are available.
Added byte-by-byte string extraction