"Nige" <nkarnold@[EMAIL PROTECTED]
> wrote in message
news:Nkzjf.110669$Es4.109854@[EMAIL PROTECTED]
> Hello.
>
> Can anyone help me with the Dephi function below...
>
> const CC_TIME = $3f;
byte mask
>
> procedure TvStripForm.AddTime(var sum: array of Byte; b: array of Byte);
> var
> i: Integer;
> max_f: Integer;
> begin
> for i := Low(sum) to High(sum) do
lowest index of s highest index of s
> Inc(sum[i], (b[i] and CC_TIME));
logical and with mask of byte b[i]
add it to sum[i]
( there could probably be some sanity checks, or code assumes
these checks have been made at calling level
dunno why the dynamic arrays and indexes, the rest only operates on 4
bytes
that could pass as a native
)
> max_f := 25;
> if ((b[3] and (not CC_TIME_)) = 192) then
> max_f := 30;
invert cc_time , logical and with byte b[3]
if it is same as byte 192 then max_f=25 otherwise no change
>
> if (sum[3] >= max_f) then begin
> Dec(sum[3], max_f);
> Inc(sum[2]);
> end;
add with carry , ripple changes
> if (sum[2] >= 60) then begin // seconds
> Dec(sum[2], 60);
> Inc(sum[1]);
> end;
> if (sum[1] >= 60) then begin // minutes
> Dec(sum[1], 60);
> Inc(sum[0]);
> end;
> end;
>
>
> I wan't to create the same function in Visual Basic, but Im struggling,
as
I
> don't really know Delphi all that well. We dont intend to leave Delphi
> behind, someone in our department wants to see if VB tackles the above
> function, as he thinks it will be a much long winded away around..
> personally I dont think it will.
What I know about VB is locked in a little mental rubber room
and classified never to be released.
probably not much difference, 'tis fairly simple code, basic even :-)
and not worth much when considering development environments,
they manage code layouts and debugging , not bit twiddling


|