Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can do function like follows in Libre Office

I'm new with this Basic language. I have a Java back round and I can't run the following Function. How do I need to setup it to run in LibreOffice. Apparently Function can not be called inside functions LibreOffice Basic?


Sub Main

End Sub

Function pPeriod(months, qLed, qHalo, lifeLed, lifeHalo, hoursD, pLed, pHalo, tranFee, ePrice)

For iCount = 0 To months
    newLeds = ROUNDDOWN((iCount*hoursD*30/lifeLed);1)
    newHalos = ROUNDDOWN((iCount*hoursD*30/lifeHalo);1)
    qLed = qLed + newLeds
    qHalo = qHalo + newHalos
    newPriceLeds = qLed*pLed + tranFee + 30*hoursD*ePrice
    newPriceHalos = qHalo*pHalo + tranfee + 30*hoursD*ePrice
    If newPriceLeds > newPriceHalos = True Then Exit For

Print i

End Function