I ask for help to convert ArrayList <Byte> Java in B4A
public static void AddRange (ArrayList <Byte> array, byte [] newData)
{
for (int index = 0; index <newData.length; index ++)
{
array.add (newData [index]);
}
}
// function
ArrayList <Byte> commands = new ArrayList <Byte> ();
Byte [] initCommand = new byte [] {0x1b, 0x40}; // Initialization
AddRange (commands, initCommand);
Byte [] slashedZeroCommand = new byte [] {0x1b, 0x2f, 0x00};
if (slashedZero)
{
slashedZeroCommand [2] = 49;
}
else
{
slashedZeroCommand [2] = 48;
}
AddRange (commands, slashedZeroCommand);
......
thank you very much
public static void AddRange (ArrayList <Byte> array, byte [] newData)
{
for (int index = 0; index <newData.length; index ++)
{
array.add (newData [index]);
}
}
// function
ArrayList <Byte> commands = new ArrayList <Byte> ();
Byte [] initCommand = new byte [] {0x1b, 0x40}; // Initialization
AddRange (commands, initCommand);
Byte [] slashedZeroCommand = new byte [] {0x1b, 0x2f, 0x00};
if (slashedZero)
{
slashedZeroCommand [2] = 49;
}
else
{
slashedZeroCommand [2] = 48;
}
AddRange (commands, slashedZeroCommand);
......
thank you very much