Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Write binary file . URGENT !!!!!

Write binary file . URGENT !!!!!

Scheduled Pinned Locked Moved Visual Basic
data-structuresquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mimi
    wrote on last edited by
    #1

    How could I put a array of bytes into a file ???

    D F 2 Replies Last reply
    0
    • M mimi

      How could I put a array of bytes into a file ???

      D Offline
      D Offline
      David Wengier
      wrote on last edited by
      #2

      Dim b() as Byte
      'Do something with b
      Open "filename.txt" For Binary As #1
      Put #1, , b
      Close #1

      Should work... -- David Wengier Sonork ID: 100.14177 - Ch00k

      1 Reply Last reply
      0
      • M mimi

        How could I put a array of bytes into a file ???

        F Offline
        F Offline
        Fernando Finelli
        wrote on last edited by
        #3

        I don't know if you mean this, sorry if don't

        Open "outputfile" for output as #1

        For intI = 1 to ubound(arrArrayName)
        print #1, arrArrayName(intI)
        Next intI

        Close 1

        See: Syntax Open pathname For mode [Access access] [lock] As [#]filenumber [Len=reclength] The Open statement syntax has these parts: Part Description pathname Required. String expression that specifies a file name — may include directory or folder, and drive. mode Required. Keyword specifying the file mode: Append, Binary, Input, Output, or Random. If unspecified, the file is opened for Random access. access Optional. Keyword specifying the operations permitted on the open file: Read, Write, or Read Write. lock Optional. Keyword specifying the operations restricted on the open file by other processes: Shared, Lock Read, Lock Write, and Lock Read Write. filenumber Required. A valid file number in the range 1 to 511, inclusive. Use the FreeFile function to obtain the next available file number. reclength Optional. Number less than or equal to 32,767 (bytes). For files opened for random access, this value is the record length. For sequential files, this value is the number of characters buffered. Fernando Finelli

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups