Other Programming Languages

NAVIGATION
CATEGORIES
LINKS
Home » Other Languages »» Other Programming Languages
  • VB to Delphi or Explination

    0 answers - 1135 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg

    Hi, i was buzy putting a bit of code into delphi and came along this function. I'm not totally sure what the open or put does. And i cant seem to find the delphi equalevant.

    Function WriteBinFile(ByVal bfilename As String, vtData As Variant)
    Dim FileNum As Long
    Dim binbyte() As Byte
    On Error GoTo errHandler

    binbyte = vtdata
    FileNum = FreeFile
    Open bfilename for Binary Access Write As #FileNum
    Put #FileNum, , binbyte
    Close #FileNum
    Exit Function
    errHandler:
    Exit Function
    End Function

    So far i made it into this:

    Function writeBinFile(bfilename: String; vtdata :Variant):TStream;
    Var
    FileNum : Integer;
    binbyte : Byte;
    begin
    binbyte := vtData;
    FreeAndNil(FileNum);
    Open bfilename For Binary Access Write As FileNum;
    Put #FileNum, , binbyte;
    Close #FileNum;
    end;

    I've no idea what open/put/close/#/FreeFile is.

    Any input will be appreciated.

    Thanks
    Anton

    Ok fixed this using Stream.size/stream.write/stream.position
    :D

Re: VB to Delphi or Explination


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
SPONSORED
QUESTION

SPONSORED
VISUAL BASIC TECHNOLOGIES