Ask Your Question

how do we call a sub? in libreoffice basic [closed]

asked 2014-06-13 16:20:21 +0100

altair gravatar image

updated 2014-06-13 16:23:13 +0100

Hello! If we have a sub:

sub a v= x+c

... end sub

how can we call a value we get in there, if we need it for sth? /f.e. I need that v for some other computings.. /or does it have to be a function, f,e, and not a sub? Many thanks!!!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-25 09:59:04.057333

1 Answer

Sort by » oldest newest most voted

answered 2014-06-13 17:24:17 +0100

mahfiaz gravatar image

To return values from the function assign it to variable named after the sub itself:

sub mysum a, b
  mysum = a + b
end sub

sum = mysum(4,5)
' Alerts 9
edit flag offensive delete link more


@karolus, thanks for correcting.

mahfiaz gravatar imagemahfiaz ( 2014-06-13 19:08:54 +0100 )edit

Question Tools

1 follower


Asked: 2014-06-13 16:20:21 +0100

Seen: 200 times

Last updated: Jun 13 '14