[EDIT was writing this while empty was responding - I'm assuming a custom bit configuration 8 8 7 to be reduced when necessary to 4 4 4]
The smallest number you can write directly to a file is 1 byte or 8 bits in DBC. However, if you have a series of 4 bit numbers, you can store them in two groups of 4 or 1 byte in a memblock. Then write the entire memblock to a file at once. You'd have to do the conversion in and out to get the number you wanted.
This example uses TDKs binary to decimal string converter function. This example isn't optimized and just shows how to get the numbers in and out of the memblock once you've reduced them to their 4 bit values. Because your example shows 3 4 bit groups, I had to add a zero fill to make the last value a whole byte. Depending on the number of inputs, you would only need the 0000 fill at the end of the memblock if the number of inputs was uneven.
rem out of 0100 0110 0110
rem create 2 groups of 8 bit numbers
rem 01000110
rem 01100000
value=bintodec("01000110")
value2=bintodec("01100000")
make memblock 1,2
write memblock byte 1,0,value
write memblock byte 1,1,value2
rem get back the numbers into your 4 bit components
value3 = memblock byte(1,0)
value4 = memblock byte(1,1)
for n=26 to 29
first4bit$=first4bit$+mid$(bin$(value3),n)
next n
print first4bit$
for n=30 to 33
next4bit$=next4bit$+mid$(bin$(value3),n)
next n
print next4bit$
end
Function BinToDec(B$)
rem TDKs binary string to dec function
If Left$(B$,1) = "%" Then B$ = Right$(B$,Len(B$)-1)
L = Len(B$): DecVal = 0
For N = L To 1 Step -1
If Mid$(B$,N)="1" Then Inc DecVal, 2^(L-N)
Next N
EndFunction DecVal
Enjoy your day.