How to put a big file into a variable?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raymond H.

    #1

    How to put a big file into a variable?

    Hello,
    I'm not able to put a big file (600Mo) into VarDonnéesDuFic hier3 .
    With the MsgBox line, VarDonnéesDuFic hier3 displays zero (o). Where is my
    problem? Is there an other way to open a big file (600Mo) into
    VarDonnéesDuFic hier3 (with the special data like a mpeg) ?

    Dim VarDonnéesDuFic hier3 as String
    NumFichier = FreeFile
    Open Text2.Text For Binary Access Read As #NumFichier
    VarDonnéesDuFic hier3 = Space$(LOF(NumF ichier))
    MsgBox VarDonnéesDuFic hier3 'VarDonnéesDuFi chier3 gave zero (0) with a 600
    Mo file.
    Get #NumFichier, 1, VarDonnéesDuFic hier3
    Close #NumFichier
    =============== =============== ==========
    a+
    Raymond H.
    --
    divers_rh@hotma il.com


  • Randy Birch

    #2
    Re: How to put a big file into a variable?

    Uh, yea, no kidding! For a messagebox, try 250 or so characters, not 600mo
    (whatever a mo is).

    To open and read a large file use Binary file access and do the reading in
    chunks of 64k.

    --


    Randy Birch
    MS MVP Visual Basic



    "Raymond H." <divers_rh@hotm ail.com> wrote in message
    news:hNUfd.1279 4$Qs6.1216912@n ews20.bellgloba l.com...
    : Hello,
    : I'm not able to put a big file (600Mo) into VarDonniesDuFic hier3 .
    : With the MsgBox line, VarDonniesDuFic hier3 displays zero (o). Where is my
    : problem? Is there an other way to open a big file (600Mo) into
    : VarDonniesDuFic hier3 (with the special data like a mpeg) ?
    :
    : Dim VarDonniesDuFic hier3 as String
    : NumFichier = FreeFile
    : Open Text2.Text For Binary Access Read As #NumFichier
    : VarDonniesDuFic hier3 = Space$(LOF(NumF ichier))
    : MsgBox VarDonniesDuFic hier3 'VarDonniesDuFi chier3 gave zero (0) with a
    600
    : Mo file.
    : Get #NumFichier, 1, VarDonniesDuFic hier3
    : Close #NumFichier
    : =============== =============== ==========
    : a+
    : Raymond H.
    : --
    : divers_rh@hotma il.com
    :
    :

    Comment

    • Raymond H.

      #3
      Re: How to put a big file into a variable?

      Hello,
      mo is MegaBytes in french (MB). Do you have an axample about your
      'chunks of 64k'?
      a+
      Raymond H.

      "Randy Birch" <rgb_removethis @mvps.org> a écrit dans le message de news:
      O4Odnf2pR8Lpwh3 cRVn-uw@rogers.com...[color=blue]
      > Uh, yea, no kidding! For a messagebox, try 250 or so characters, not
      > 600mo
      > (whatever a mo is).
      >
      > To open and read a large file use Binary file access and do the reading in
      > chunks of 64k.
      >
      > --
      >
      >
      > Randy Birch
      > MS MVP Visual Basic
      > http://vbnet.mvps.org/
      >
      >
      > "Raymond H." <divers_rh@hotm ail.com> wrote in message
      > news:hNUfd.1279 4$Qs6.1216912@n ews20.bellgloba l.com...
      > : Hello,
      > : I'm not able to put a big file (600Mo) into VarDonniesDuFic hier3 .
      > : With the MsgBox line, VarDonniesDuFic hier3 displays zero (o). Where is
      > my
      > : problem? Is there an other way to open a big file (600Mo) into
      > : VarDonniesDuFic hier3 (with the special data like a mpeg) ?
      > :
      > : Dim VarDonniesDuFic hier3 as String
      > : NumFichier = FreeFile
      > : Open Text2.Text For Binary Access Read As #NumFichier
      > : VarDonniesDuFic hier3 = Space$(LOF(NumF ichier))
      > : MsgBox VarDonniesDuFic hier3 'VarDonniesDuFi chier3 gave zero (0) with a
      > 600
      > : Mo file.
      > : Get #NumFichier, 1, VarDonniesDuFic hier3
      > : Close #NumFichier
      > : =============== =============== ==========
      > : a+
      > : Raymond H.
      > : --
      > : divers_rh@hotma il.com
      > :
      > :
      >[/color]


      Comment

      • preben nielsen

        #4
        Re: How to put a big file into a variable?


        "Raymond H." <divers_rh@hotm ail.com> skrev i en meddelelse
        news:hNUfd.1279 4$Qs6.1216912@n ews20.bellgloba l.com...[color=blue]
        > Hello,
        > I'm not able to put a big file (600Mo) into
        > VarDonnéesDuFic hier3 .[/color]

        Why would you want to ??? No human will like to read 600Mb just
        like that ;-)

        And in a Msgbox ???

        --
        /\ preben nielsen
        \/\ prel@post.tele. dk


        Comment

        • Raymond H.

          #5
          Re: How to put a big file into a variable?

          Hello,
          it's for a software, not cessessary for the humain read but for the
          traitement in the software.
          a+
          Raymond H

          "preben nielsen" <prel@post.tele .dk> a écrit dans le message de news:
          4180aa8f$0$290$ edfadb0f@dread1 2.news.tele.dk. ..[color=blue]
          >
          > "Raymond H." <divers_rh@hotm ail.com> skrev i en meddelelse
          > news:hNUfd.1279 4$Qs6.1216912@n ews20.bellgloba l.com...[color=green]
          >> Hello,
          >> I'm not able to put a big file (600Mo) into VarDonnéesDuFic hier3 .[/color]
          >
          > Why would you want to ??? No human will like to read 600Mb just like that
          > ;-)
          >
          > And in a Msgbox ???
          >
          > --
          > /\ preben nielsen
          > \/\ prel@post.tele. dk
          >[/color]


          Comment

          • Raoul Watson

            #6
            Re: How to put a big file into a variable?

            "Raymond H." <divers_rh@hotm ail.com> wrote in message
            news:hNUfd.1279 4$Qs6.1216912@n ews20.bellgloba l.com...[color=blue]
            > Hello,
            > I'm not able to put a big file (600Mo) into VarDonnéesDuFic hier3 .
            > With the MsgBox line, VarDonnéesDuFic hier3 displays zero (o). Where is my
            > problem? Is there an other way to open a big file (600Mo) into
            > VarDonnéesDuFic hier3 (with the special data like a mpeg) ?
            >
            > Dim VarDonnéesDuFic hier3 as String
            > NumFichier = FreeFile
            > Open Text2.Text For Binary Access Read As #NumFichier
            > VarDonnéesDuFic hier3 = Space$(LOF(NumF ichier))
            > MsgBox VarDonnéesDuFic hier3 'VarDonnéesDuFi chier3 gave zero (0) with a[/color]
            600[color=blue]
            > Mo file.
            > Get #NumFichier, 1, VarDonnéesDuFic hier3
            > Close #NumFichier[/color]

            Did you try using a Richtextbox instead?
            Maybe there is a better way of reading 600Mb worth of data. If you elaborate
            why you need it in a continuous string maybe someone can figure out an
            alternative way.


            Comment

            Working...