Share - settlement date

Salam,

Is it authorized to immediately use the funds from a sale of shares, to buy back other shares?

Before, the settlement date of the first sale.

Thanks,