Libreoffice basic, inputbox, sub, a=2*b

Hello!
I want a macro which would write double sum of the number I wwrite in.
I tried to input the number b by inputbox.

sub s
dim b as integer
InputBox("Write number b", "Double b")
...

how can I get that b gets the value I input into the Inputbox?

Many thanks!!!

What you are after is string concatenation, so to help you with all your other upcoming problems as well, I’ll do it this way: http://lmgtfy.com/?q=libreoffice+basic+string+concatenation+operator

Edit:

InputBox Function [Runtime] - LibreOffice Help has the following snippet:

Sub ExampleInputBox
Dim sText As String
    sText = InputBox ("Please enter a phrase:","Dear User")
    MsgBox ( sText , 64, "Confirmation of phrase")
End Sub

Now all you need is to convert sText to integer with Int() and multiply it, e.g b = a * 2, but I’d leave implementing it as an exercise for the reader.

Hello!
I ment macro as a function which would give a number double than the one I entered

f.i Inter in the inputbox nr 4 and get printed 8