Results 1 to 5 of 5

Thread: VB6 GitHub Linebreak Repair

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,099

    VB6 GitHub Linebreak Repair


    I've been downloading a lot of VB6 projects from GitHub to test in twinBASIC. When these have been uploaded with certain settings, GitHub replaces the vbCrLf line breaks with vbLf only, which results in a corrupt file that VB6 can't read. tB can-- but I need to confirm working in VB6 first. So I made this small project to automatically repair the line breaks of all VB6 files in a given directory, with a number of options to help. The file type list is preset, but you could change it to work on any file type instead.

    This project uses my tbShellLib project for all the APIs (this is why the source file size is so large; however the compiled exe uses only what is neccessary, so is only 2MB). Can be compiled to both 32bit and 64bit. I've tested to confirm the output is byte for byte identical to using WinHex to manually replace 0x0A with 0x0D 0x0A, and the app checks whether the line breaks already appear to be correct.

    I've gotta say, I use to always put my APIs locally, copying them into each project. But I'm *really* starting to like having 99%+ of the Windows APIs on tap and programming like I'm in C++ with #include <Windows.h>. tbShellLib is up to like 5,500 APIs now (not counting the A/W variants).

    Written in twinBASIC, but trivially simple to convert to VB6 if you must... the Utility Bank doesn't seem to be language-specific. The repository also has builds.

    https://github.com/fafalone/LinebreakRepair

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,894

    Re: VB6 GitHub Linebreak Repair

    If you're using GitHub, presumably that means you're using Git BASH for version control. If that's the case are you aware that there's a command you can run in BASH to ensure that all files have CRLF line endings in the repository? It is simply just:
    Code:
    git config --global core.autocrlf true
    I had this issue when working on a PHP project between Linux and Windows machines. Any time I would pull down my changes and open it in my editor, my diff was polluted with the line endings changing. Digging around I found the solution above and it has done me well ever since.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3
    Fanatic Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    522

    Re: VB6 GitHub Linebreak Repair

    good job Faf

  4. #4
    Addicted Member
    Join Date
    Feb 2022
    Posts
    189

    Re: VB6 GitHub Linebreak Repair

    Quote Originally Posted by dday9 View Post
    If you're using GitHub, presumably that means you're using Git BASH for version control... Digging around I found the solution above and it has done me well ever since...
    HA! never presume anything, even as a moderator. I haven't known of a VB6 programmer in my lifetime happily using a command prompt for anything... hence the name "Visual"? get it? haha !!! Anyway, it's always great to be aware of command prompt utilities and I thank you for that.

    Otherwise, thank you fafalone for this great little GUI.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,099

    Re: VB6 GitHub Linebreak Repair

    Yeah I don't use GitHub on the desktop at all. Just the web interface. I'm a hobbyist, for my uses I've played around with serious version control but it just wasn't worth the time IMO. If I ever go back to commercial work, then I'd use it for that.

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