[Gambas-user] Gambas equivilent help

briansykes brisykes at ...626...
Sun Oct 25 18:28:17 CET 2009


Sorry i hit the wrong link, but here it is again. sorry.

private BitSet a(char ac[])
    {
        int i1 = ac.length * 8;
        BitSet bitset = new BitSet(i1);
        for(int j1 = 0; j1 < i1; j1++)
        {
            int k1 = j1 & 7;
            int l1 = j1 >> 3;
            if((ac[l1] & 0xff & 1 << 7 - k1) != 0) ' This is the thing i
cant understand.
                bitset.set(j1);
        }

        return bitset;
    }

Private Function a2(ac As String) as Byte[]

  Dim i1 as Integer
  Dim bitset as Byte[]
  Dim j1 as Integer
  Dim l1 as Integer
  Dim k1 as Integer
  
  i1 = Len(ac) * 8
  bitset = New Byte[i1]
  For j1 = 0 To i1
    k1 = j1 AND 7
    l1 = Lsr(j1, 3)
    'If statement here
  Next
  Return bitset

End

Fabien Bodard-4 wrote:
> 
> Private Function a( BitSet as Byte[]) as Byte[]
>   Dim BitSet1 as New Byte[64]
>   Dim Flag as Boolean = false
>   Dim i As Integer
> 
>   For i = 0 to 64-1
>     If Flag<>BitSet[i] Then BitSet1[i]=True
>     Flag = BitSet[i]
>   Next
> 
> return BitSet1
> 
> 2009/10/25 briansykes <brisykes at ...626...>:
>>
>> I'm trying to convert some java code to Gambas and i cant seem to get it
>> to
>> work at all here is the code.
>>
>> private BitSet a(BitSet bitset)
>>    {
>>        BitSet bitset1 = new BitSet(64);
>>        boolean flag = false;
>>        for(int i1 = 0; i1 < 64; i1++)
>>        {
>>            if(flag != bitset.get(i1))
>>                bitset1.set(i1);
>>            flag = bitset.get(i1);
>>        }
>>
>>        return bitset1;
>>    }
>>
>>
>> Benoît Minisini wrote:
>>>
>>>> Very simple question that i cant seem to answer on my own: What is the
>>>>  gambas equivilent of the java BitSet class? is it a Byte[] array? i
>>>> dont
>>>>  know but thats about the only thing i could think of.
>>>>
>>>
>>> There is no equivalent of the Java BitSet class. You must implement it
>>> by
>>> your
>>> own, and you can use a Byte array for that if you want.
>>>
>>> Regards,
>>>
>>> --
>>> Benoît Minisini
>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and
>>> stay
>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>> http://p.sf.net/sfu/devconference
>>> _______________________________________________
>>> Gambas-user mailing list
>>> Gambas-user at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Gambas-equivilent-help-tp26044750p26048007.html
>> Sent from the gambas-user mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 

-- 
View this message in context: http://www.nabble.com/Gambas-equivilent-help-tp26044750p26049950.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list