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. FilePutObject assistance, please

FilePutObject assistance, please

Scheduled Pinned Locked Moved Visual Basic
helpquestion
2 Posts 2 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.
  • I Offline
    I Offline
    IceWater42
    wrote on last edited by
    #1

    Hi ... i need a little help, please. This code works fine, but i'd like to convert it to use FilePutObject. Private Structure myFriend Public name As String Public age As Integer End Structure … Dim friendFileName As String = "R:\MyFriends.txt" FileOpen(1, friendFileName, OpenMode.Binary) Dim aFriend As myFriend ' Create a friend object aFriend.name = "Laura" aFriend.age = 29 FilePut(1, aFriend) ' Write entire structure to the hard drive What would be the FilePutObject equivalent of the last statement (above)? FilePutObject(1, aFriend) … does not do it Thanks.

    A 1 Reply Last reply
    0
    • I IceWater42

      Hi ... i need a little help, please. This code works fine, but i'd like to convert it to use FilePutObject. Private Structure myFriend Public name As String Public age As Integer End Structure … Dim friendFileName As String = "R:\MyFriends.txt" FileOpen(1, friendFileName, OpenMode.Binary) Dim aFriend As myFriend ' Create a friend object aFriend.name = "Laura" aFriend.age = 29 FilePut(1, aFriend) ' Write entire structure to the hard drive What would be the FilePutObject equivalent of the last statement (above)? FilePutObject(1, aFriend) … does not do it Thanks.

      A Offline
      A Offline
      AliAmjad
      wrote on last edited by
      #2

      Use Print() function instead you can accomplish it by using the following code:

      FileOpen(1, "File Name", OpenMode.Output)
      Print(1, "Data to save")
      FileClose(1)

      Hope it helps !

      AliAmjad(MCP)

      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