No, it is not mandatory to have a FUNCTION MAIN()! If you do not define it, the first function defined in the first linked PRG is executed at startup. But if you define it then the Harbour and xHarbour behaviour is different: Harbour executes it even if it is not in the first linked ...