Page 1 of 2 12 LastLast
Results 1 to 40 of 66

Thread: Open, Print and Close File I/O commands for visual basic

  1. #1

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Open, Print and Close File I/O commands for visual basic

    Hello members it is I again, ThEiMp, again so.

    I need to know how to write the syntax of the EOF line in the Open and Close command block for File I/O process. I am trying to write a data file, but then i have to read it from the resource file library. this part i have done, but then just need to have the EOF process implemented into my project.

    !! Thanks in advance !!
    Attached Files Attached Files
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,526

    Re: Open, Print and Close File I/O commands for visual basic

    Post the code inside code tags so we do not have to download, unzip, and load it to look at it.

  3. #3
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Open, Print and Close File I/O commands for visual basic

    It is tough to make out what post #1 is trying to say.

    Looking at the code, it appears to be a "dropper" extracting embedded JPEG resources to files. Just to turn around and use LoadPicture() on them. Similar goofiness for other files (.flv).

    But it is playing a large number of reindeer games, transcoding binary data from ANSI to Unicode, and then using text I/O to write the file. Lots of garbage gets created in C:\temp which may not even exist on a lot of systems. Chaos!


    Why not just throw all of this away?

    People go to weird extremes to try to circumvent using an installer.

  4. #4

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    Okay I will post the source code in code tags, here
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  5. #5

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    Code:
    Option Explicit
    '
    Dim a As Integer
    Dim Item1 As String
    Dim PauseTime, Start, Finish, TotalTime
    '
    
    Public Sub Form_Activate()
    On Error Resume Next
    
    a = 0
    
        With App
            .TaskVisible = False
    
            If .PrevInstance = False Then Exit Sub
            If .PrevInstance = True Then Unload Main
        End With
    End Sub
    Public Sub Form_Load()
    On Error Resume Next
    
    a = a + 1
    Item1 = (StrConv(LoadResData("SEASON1", "EP" & a), vbUnicode))
    
        MkDir ("C:\Temp\Video1234567890")
    
        Blah Blah Blah Blah   
        
        Open ("C:\Temp\Video1234567890\Image1234567890.jpg") For Output As #1
            Print #1, (StrConv(LoadResData("IMAGE", "DATA"), vbUnicode))
        Close #1
            
        With Main
            .picBox.Picture = LoadPicture("C:\Temp\Video1234567890\Image1234567890.jpg")
            .rtbText.TextRTF = (StrConv(LoadResData("TEXT", "DATA"), vbUnicode))
        End With
        
        With Main.CustomDialog1
            .Action = 2
            .Data = (StrConv(LoadResData("EP" & Item1, "SEASON1"), vbUnicode))
            .DefaultFilter = "flv"
            .FileName = "Video1234567890"
            .Filter = "flv"
            .FilterEnabled = False
            .Path = "C:\Temp\Video1234567890"
        End With
        
        With Main.CustomDialog1
            Open ("C:\Temp\Video1234567890\Video1234567890.flv") For Output As #1
                Print #1, .Data
            Close #1
        End With
        
    1   With Main
            .Timer1.Interval = .Timer1.Interval - 1
    
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 2
    
    2       .WMP.URL = ("C:\Temp\Video1234567890\Video1234567890.flv")
    
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 3
    
    3       .picBox.Visible = False
        End With
        
        Item1 = ""
    End Sub
    Public Sub Form_Resize()
    On Error Resume Next
    
    Dim FormLeft As Long
    Dim FormTop As Long
    
        With Main
            FormLeft = .Left
            FormTop = .Top
            .Left = FormLeft
            .Top = FormTop
            .Height = 7515
            .Width = 15870
         End With
    End Sub
    Public Sub Form_Unload(Cancel As Integer)
    On Error Resume Next
    
    Set Main = Nothing
    
        RmDir ("C:\Temp\Video1234567890")
    
        Unload Main
    End Sub
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  6. #6
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: Open, Print and Close File I/O commands for visual basic

    Like dilettante already stated, you use all kind of string conversions and text based file IO.
    Your data is a movie, so it's not text and should NOT be handled with string functions.

  7. #7

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    what about in binary data encoding
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  8. #8
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: Open, Print and Close File I/O commands for visual basic

    Just get the data as a byte blob with "LoadResData("SEASON1", "EP" & a)"
    Then dump it with file mode in binary
    Code:
    ' Untested air code
    Dim btData() As Byte
    Dim fID As Integer
    
    btData = LoadResData("SEASON1", "EP" & a)
    fID = FreeFile
    Open "C:\Temp\YourFile.flv" For Binary As #fID
    Put #fID,,btData
    Close #fID

  9. #9

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    Thanks for the input, then matey
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  10. #10

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    My source code, looks like this now, so:
    Code:
    Dim aa As Integer
    Dim Item2 As Byte
    
    Blah Blah
    
        Open ("C:\Temp\Video1234567890\Video1234567890.flv") For Binary As #1
            Put #aa, , Item2
        Close #1
    The data file, inflates to about five bytes, so then something is happening there so. What is the EOF line looks like. I would have to use that to finish off the code block, I guess now???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  11. #11
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: Open, Print and Close File I/O commands for visual basic

    To start it should be a byte array, not a single byte.
    Second you don't write EOF.

    Code:
    Dim btData() As Byte
    Dim fID As Integer
    
    btData = LoadResData("SEASON1", "EP" & a)
    fID = FreeFile
    Open "C:\Temp\YourFile.flv" For Binary As #fID
    Put #fID,,btData
    Close #fID

  12. #12
    Fanatic Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    Turkey, down the old sides of Fatih
    Posts
    607

    Re: Open, Print and Close File I/O commands for visual basic

    yeah, Actually he can, but data corruption has an %99 chance of happening, I tried before by reading an 24 bit .BMP and sending through mscomm with inputmode=text

  13. #13
    Fanatic Member gaouser's Avatar
    Join Date
    Mar 2022
    Location
    Turkey, down the old sides of Fatih
    Posts
    607

    Re: Open, Print and Close File I/O commands for visual basic

    yeah, He needs byte array, I think he doesnt have experience with low level.

  14. #14

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    I can't remember the syntax of loading files, though
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  15. #15
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,598

    Re: Open, Print and Close File I/O commands for visual basic

    For a binary file, you just preset the size of the array to what you are going to read from the file, and then just use "Get" to fill the array.
    Something along these lines should work.
    Code:
      Open "c:\c\Alarm01.wav" For Binary As #1
      ReDim btData(LOF(1) - 1) As Byte
      Get #1, , btData
      Close #1
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

  16. #16

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    Thanks for the input
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  17. #17

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    -- For a 43.1MB file, it is taking nearly 34hours for it to import the data into the file, and then it's still working on it. Also it's still working on the file data size, also still. OMG what do i do, to import the data quickly, then so???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  18. #18
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: Open, Print and Close File I/O commands for visual basic

    Show the actual code you used

  19. #19
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,268

    Re: Open, Print and Close File I/O commands for visual basic

    Quote Originally Posted by ThEiMp View Post
    -- For a 43.1MB file, it is taking nearly 34hours for it to import the data into the file, and then it's still working on it. Also it's still working on the file data size, also still. OMG what do i do, to import the data quickly, then so???
    "Get" (in Binary mode) takes a second argument, at which byte to start reading.
    So, read it in chunks.
    it might even be an idea, to put the reading file stuff into an ActiveX-DLL, and use mutiple threads.
    Filesize 40 MB
    Thread 1 reads Byte 1 to 5M
    Thread 2 reads 5M+1 to 10M
    and so on....
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  20. #20
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: Open, Print and Close File I/O commands for visual basic

    I can't believe that reading/writing a 43MB file can take up to 34 hours, that is 15 bytes per second
    There must some other problem.

    When working from home and connecting to the office network using WiFi then I thought access was slow, but that's at least 0,6MB per second.

  21. #21

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    you just have to wait, i am sick with the flu and taking time off work, then so
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  22. #22
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,915

    Re: Open, Print and Close File I/O commands for visual basic

    43MB, personally, I'd just read it all into memory in one chunk. That's not that big a file.

    I read files that large all the time (both ASCII and binary). And, I've never timed it, but they don't take any time at all to read into a variable (I'd say less than a second).

    ---------------

    And personally, IDK, but I'm thinking someone who doesn't know basic file I/O should either explore their VB6 F1's MSDN, and/or they should pull a BASIC programming book off their shelf. In many ways, this is one of the very first things you should learn, after figuring out what a variable is and how to write a loop.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  23. #23

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    so then what is the source code to load a 43.1Mb plus or minus that size, into memory, then??? I really like to know about this one, thanks for the help, guys
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  24. #24
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: Open, Print and Close File I/O commands for visual basic

    Quote Originally Posted by passel View Post
    For a binary file, you just preset the size of the array to what you are going to read from the file, and then just use "Get" to fill the array.
    Something along these lines should work.
    Code:
      Open "c:\c\Alarm01.wav" For Binary As #1
      ReDim btData(LOF(1) - 1) As Byte
      Get #1, , btData
      Close #1
    This is the most basic way to read a file in a single action.

  25. #25

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    yeah but then something that i had over looked when writing the data file, which then to use the put command, instead of the get command, which works that much slower to read and write to the disk, which i am using to do this with
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  26. #26

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    here is my project source code as follows:
    Code:
    Public Sub Form_Load()
    On Error Resume Next
    
    a = a + 1
    Item1 = (StrConv(LoadResData("SEASON1", "EP" & a), vbUnicode))
    
        With Main.picBox
            .ZOrder 0
        End With
    
        MkDir ("C:\Temp\Video1234567890")
        
        With Main.CustomDialog1
            .Action = 2
            .Data = Item1
            .FileName = "\Video1234567890.flv"
            .Path = "C:\Temp\Video1234567890"
        End With
        
        Open ("C:\Temp\Video1234567890\Video1234567890.flv") For Binary As #1
        ReDim btData(LOF(1) - 1) As Byte
            Get #1, , Item1
        Close #1
    
        Open ("C:\Temp\Video1234567890\Video1234567890.flv") For Binary As #1
        ReDim btData(LOF(1) - 1) As Byte
            Put #1, , Item1
        Close #1
    
        With Main
            .WMP.URL = ("C:\Temp\Video1234567890\Video1234567890.flv")
            .picBox.ZOrder 1
        End With
    End Sub
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  27. #27
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,958

    Re: Open, Print and Close File I/O commands for visual basic

    Quote Originally Posted by ThEiMp View Post
    here is my project source code as follows:
    Code:
    Public Sub Form_Load()
    On Error Resume Next
    
    a = a + 1
    Item1 = (StrConv(LoadResData("SEASON1", "EP" & a), vbUnicode))
    
        With Main.picBox
            .ZOrder 0
        End With
    
        MkDir ("C:\Temp\Video1234567890")
        
        With Main.CustomDialog1
            .Action = 2
            .Data = Item1
            .FileName = "\Video1234567890.flv"
            .Path = "C:\Temp\Video1234567890"
        End With
        
        Open ("C:\Temp\Video1234567890\Video1234567890.flv") For Binary As #1
        ReDim btData(LOF(1) - 1) As Byte
            Get #1, , Item1
        Close #1
    
        Open ("C:\Temp\Video1234567890\Video1234567890.flv") For Binary As #1
        ReDim btData(LOF(1) - 1) As Byte
            Put #1, , Item1
        Close #1
    
        With Main
            .WMP.URL = ("C:\Temp\Video1234567890\Video1234567890.flv")
            .picBox.ZOrder 1
        End With
    End Sub
    Are you trying to write to the temp file or read from it? Your code send to be opening a file, reading from it and then immediately writing back exactly what you have just read from it.

    If you step through this code in a debugger what is happening?

  28. #28

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    i thought that i had to convert it from the resource which is 2 Bytes long and then write the inflated file, which is something like 43.1Mb long
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  29. #29
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,958

    Re: Open, Print and Close File I/O commands for visual basic

    Quote Originally Posted by ThEiMp View Post
    i thought that i had to convert it from the resource which is 2 Bytes long and then write the inflated file, which is something like 43.1Mb long
    You are making no sense. Think about this logically and take it step by step.

    Code:
    Item1 = (StrConv(LoadResData("SEASON1", "EP" & a), vbUnicode))
    that line is loading what is presumably binary data into a variable called item1. This is probably incorrect anyway because if it is binary data yuo shouldn't be using StrConv on it. I am not a VB6 programmer anymore I know this because other people on this forum have already told you this

    then you do
    Code:
    Open ("C:\Temp\Video1234567890\Video1234567890.flv") For Binary As #1
        ReDim btData(LOF(1) - 1) As Byte
            Get #1, , Item1
        Close #1
    These lines are opening a file and then reading from the file into the same item1 variable this is effectively going to overwrite the contents you incorrectly loaded in the first bit of your code.

    after that the following lines
    Code:
     Open ("C:\Temp\Video1234567890\Video1234567890.flv") For Binary As #1
        ReDim btData(LOF(1) - 1) As Byte
            Put #1, , Item1
        Close #1
    are going to reopen the file you have just read into the variable item1, and then write the contents of item1 back to the file.

    Seriously, what are you expecting to happen. This isn't a programming language problem, this is a simple matter of understanding how one thing follows on from another.

    Have you tried debugging this? Have you tried to understand the logical flow of your commands, or are you just throwing code at the IDE and hoping for the best?

    Finally, if the resource is 2 bytes long it is not going to inflate to a 43Mb file, no matter how many times you insist on believing you can perform compression of a video file that achieves almost infinite compression ratios this isn't happening.

  30. #30

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    #1 - Sorry i am reading a visual basic resource file, which is in the project i am making, so.
    #2 - I am using my zip control, i wrote for this type of 2 Byte compression, like so
    Attached Files Attached Files
    Last edited by ThEiMp; Jul 9th, 2023 at 06:18 PM.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  31. #31
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: Open, Print and Close File I/O commands for visual basic

    The is no 2 byte compression, maybe it’s a simplified hash code, but certainly not compression

  32. #32

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    i have also built into it, cloaking of the ASCII data characters, in notepad/wordpad/textpad/word, etc
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  33. #33
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,958

    Re: Open, Print and Close File I/O commands for visual basic

    Quote Originally Posted by ThEiMp View Post
    #1 - Sorry i am reading a visual basic resource file, which is in the project i am making, so.
    #2 - I am using my zip control, i wrote for this type of 2 Byte compression, like so
    That makes no difference to what I asked / tried to explain. I tried to point out what your code was doing wrong, you replied by ignoring what I suggested.

    Just try debugging your code, step through it in a debugger and see what happens.

    Also, there is no such thing as 2 byte compression - you have had this explained to you many times before.

  34. #34

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    well it's something like a hash tag encryption and cloaking, like that. i have run it through a debugger process in visual basic, step by step, even. then came out with not that much, to deal with errors. then there is something wrong with the Byte dimmed variable. shouldn't it be something like String or then something like a variant, then so. i have ReDimmed the variable, but then there wasn't anything to re dim, because i hadn't used it before, i had called it up, for execution.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  35. #35
    PowerPoster VanGoghGaming's Avatar
    Join Date
    Jan 2020
    Location
    Eve Online - Mining, Missions & Market Trading!
    Posts
    2,644

    Re: Open, Print and Close File I/O commands for visual basic

    Is this like a clone of xiaoyao but on shrooms? I can't understand a word he's saying...

  36. #36

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    very sorry, you can't understand me, but then i am trying to work it out, from here, so
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  37. #37
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,958

    Re: Open, Print and Close File I/O commands for visual basic

    Quote Originally Posted by ThEiMp View Post
    well it's something like a hash tag encryption and cloaking, like that
    A "hash tag" is something you find on twitter, facebook, etc.

    If you mean a "hash" then that is a type of checksum, it can be used to prove something hasn't been tampered with - it is not however encryption. You have had this explained on here many, many times - hashes are one way, you cannot decrypt a hash.

    Encryption is a two way process, this does provide a way to go back to an original file from the encrypted version. This will not happen if you have "encrypted" your file to two bytes.

    Quote Originally Posted by ThEiMp View Post
    i have run it through a debugger process in visual basic, step by step,
    So at any point in doing this did you pay attention to the contents of the item1 variable and how it changed? Did you pay attention to the logical order of the steps you are doing? Did you still not notice that you are reading from the temp file into your item1 variable before you are writing the item1 variable to the file? I honestly don't know how clearer I can make this in pointing out your mistake.

    Quote Originally Posted by ThEiMp View Post
    even. then came out with not that much, to deal with errors.
    Debugging is a way to find logical errors

    Quote Originally Posted by ThEiMp View Post
    then there is something wrong with the Byte dimmed variable. shouldn't it be something like String or then something like a variant,
    If your resource data is a binary file, it is a absolutely correct to declare it as a byte array, binary data is just bytes. Converting it to a string is just going to corrupt the data.

    Quote Originally Posted by ThEiMp View Post
    then so. i have ReDimmed the variable, but then there wasn't anything to re dim, because i hadn't used it before, i had called it up, for execution.

    You had used it though, you load the contents of your resource into it at the very start of your routine. If you had actually stepped through your code in the debugger and looked at what it was doing and how the variables changed you would see what is happening. Just stepping through the debugger and not looking at what is going on is not debugging, it is just running your code very, very slowly.

  38. #38

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    okay then now i understand you, matey
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  39. #39

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Open, Print and Close File I/O commands for visual basic

    I have been able to come up with the special source code for my de-encryption, then all i need to do now is to get the machine to use CPU Usage more aggressively and then not too much, but then something more like 8%, because it's using 1.2% of it's handler, right now as i am using the compile-time version of my product, then working it through a stress test of the sorts
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  40. #40
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: Open, Print and Close File I/O commands for visual basic

    Wow, so you managed to de-encrypt your 2 bytes values to all different episodes of series and movies!
    Imagine that all the data in the universe can be stored in just 65536 different 2 byte value pairs.
    No more need for huge data storage devices!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width