Android Question Basic4Android operators

Torben Mortensen

New Member
Licensed User
Longtime User
Hi

Being quite new to Basic4Android I'm struggling with some sourcecode which I have adopted in order to "translate" it to objective-c.

I have not been able to locate a complete description of all Basic4Android operators anywhere.

Can anyone tell me what the "&" operator does? I have this line of code:
TextPartnumber = NumberFormat(Bit.ParseInt(Reg7Eh & Reg7Fh & Reg80h & RegA0h, 16), 4, 0);

TextPartnumber is a String variable and so are the Reg7Eh, Reg7Fh, Reg80h and RegA0h); According to Java functionality the "&" operator will do a bitwise AND of the left and right operators. Is that correct?
There is another function in the Bit library called AND so Bit.AND(Reg7Eh, Reg7Fh) would do just the same as Reg7Eh & Reg7Fh - right?

My own guess of what the above line of code does is this:
1: Bitwise ANDING the Reg7Eh, Reg7Fh, Reg80h and RegA0h string variables.
2: Converting the result into a hexadecimal representation of the resulting string (using the ParseInt).
3: Formatting the converted hexadecimal string to a stringrepresention with total length of 4 and no decimal point.

Please help - and I may be totally wrong.

/TM
 

Torben Mortensen

New Member
Licensed User
Longtime User
& - Concatenates two strings.

Where did all these Reg variables come from?

This line of code is equivalent to:
B4X:
TextPartnumber = NumberFormat(0x7E7F80A0, 4, 0)


Hi Erel

Thank you very much. So I completely misunderstood the &-operator! The Reg variables are just variables holding information from an external device.

/TM
 
Upvote 0
Top