I am trying to create a basic macro function in calc to perform a hexadecimal to binary conversion with more then 10 bits. But I've got a lot of troubles.
First, where can I find actual documentation? I only found very little examples that didn't help much and the BASIC guide is also quite succinct.
And mainly (if first doesn't respond to it), as you can see in the example below, I am trying to use CONCATENATE
inside the macro. Which is a perfectly working function inside the spreadsheet. But I get the following error message:
Sub-procedure or function procedure not defined.
So, how to use such function inside the macro, is it even possible?
Here, is the code of my macro:
Function HEX2BINREAL(hexIn as string) as string
n = len(hexIn)
Dim binOut as string
binOut = ""
For i = 1 to n
ActChar = Mid(hexIn,i,1)
Select Case ActChar
Case "0"
binOut = CONCATENATE(binOut,"0000")
Case "1"
binOut = CONCATENATE(binOut,"0001")
Case "2"
binOut = CONCATENATE(binOut,"0010")
Case "3"
binOut = CONCATENATE(binOut,"0011")
Case "4"
binOut = CONCATENATE(binOut,"0100")
Case "5"
binOut = CONCATENATE(binOut,"0101")
Case "6"
binOut = CONCATENATE(binOut,"0110")
Case "7"
binOut = CONCATENATE(binOut,"0111")
Case "8"
binOut = CONCATENATE(binOut,"1000")
Case "9"
binOut = CONCATENATE(binOut,"1001")
Case "a", "A"
binOut = CONCATENATE(binOut,"1010")
Case "b", "B"
binOut = CONCATENATE(binOut,"1011")
Case "c", "C"
binOut = CONCATENATE(binOut,"1100")
Case "d", "D"
binOut = CONCATENATE(binOut,"1101")
Case "e", "E"
binOut = CONCATENATE(binOut,"1110")
Case "f", "F"
binOut = CONCATENATE(binOut,"1111")
End Select
next i
HEX2BINREAL = binOut
end Function
Thanks
import
function? If it does, you'll need to import the function definition of Concatenate into your function before you can use it.