Error 129 on OrderClose() - page 2

 
If the OrderSelect fails, everything following is bogus. Always test return codes
if (!OrderSelect(id, SELECT_BY_TICKET)){
   Alert("OrderSelect(",id,") Failed: ", GetLastError());
   return;
}
 


Thank you guys, that was the problem.

I'm used to work in Java and some other languages which at least warn you on these kind of errors at compile time.

Thank you very much for your help.

 
RaptorUK:

OK, you have, possibly, many problems . . for example, this can't work . . .


Yeah, sometimes id is a Ticket (when I want to close) and some other times id is a AlgorithmIdentifier (when I want to open). So what you saw is correct: missing StrToInteger(id).

Thank you for your help