The 5 last Numbers of a Ticket#

 

Hi,

freshly new to mql, forex and this is my first post. I hope they'll become mor interesting and I can soon help other with improving knowledge.

I think an easy fast to answer question, but I dont find the sol by myself...

So I have an Array where the OrderTicket should be the Key and it crashs because its to long...

So I did it like this:

int Ticket = StringToInteger(StringSubstr(IntegerToString(OrderTicket()),3));

Simple works with a warning (poss data loss due to convertion), but I dont like warnings. I want my code clean like my Driving.

Is there no Substr for Integrs?

Couldnt find.

Thx for your help, and peace to the world,

bw

 
Bergwale:

Hi,

freshly new to mql, forex and this is my first post. I hope they'll become mor interesting and I can soon help other with improving knowledge.

I think an easy fast to answer question, but I dont find the sol by myself...

So I have an Array where the OrderTicket should be the Key and it crashs because its to long...

So I did it like this:

Simple works with a warning (poss data loss due to convertion), but I dont like warnings. I want my code clean like my Driving.

Is there no Substr for Integrs?

Couldnt find.

Thx for your help, and peace to the world,

bw

StringToInteger returns long (8 bit) int, so you either should store the return value in a long or explicitly tell the compiler that the value is an (4 bit) int (put "(int)" before StringToInteger).
 
Thanks!!!
Reason: