Uninitialized Variable Help

 
I have the below code in my EA. When I compile Order ticket is said to be uninitialized and the OrderSend value is said to need checking. How can i fix this?
void DeletePendingOrder( ENUM_ORDER_TYPE type  )
{
    
    long order_ticket;
    
    HistorySelect(0,TimeCurrent());
   
    for (int i=OrdersTotal()-1;i>=0;i--)
    if (order_ticket==OrderGetTicket(i))
 
    if ( OrderGetString(ORDER_SYMBOL) == Symbol() && OrderGetInteger(ORDER_TYPE) == type )
    {
        MqlTradeResult result;
        MqlTradeRequest request;
        request.order=order_ticket;
        request.action=TRADE_ACTION_REMOVE;
        OrderSend(request,result);
     
    }}
 
  1.     long order_ticket;           
        
        if (order_ticket==OrderGetTicket(i)

    Of course, order_ticket has no value. The comparison ("==") is nonsense. Perhaps you meant to assign the value to the variable from the function call ("=") and then check the result for non-zero?

  2.         OrderSend(request,result);

    Check your return codes, and report your errors (including market prices and your variables). Don't look at GLE/LE unless you have an error. Don't just silence the compiler (MT5/MT4+strict), it is trying to help you.
              What are Function return values ? How do I use them ? - MQL4 programming forum (2012)
              return value of OrderSend should be checked - Expert Advisors and Automated Trading - MQL5 programming forum (2022)
              Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles (2014)