-
Dec 9th, 2023, 05:30 PM
#1
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
-
Dec 9th, 2023, 10:28 PM
#2
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.
-
Dec 15th, 2023, 12:39 PM
#3
Fanatic Member
Re: VB6 GitHub Linebreak Repair
-
Dec 15th, 2023, 10:33 PM
#4
Addicted Member
Re: VB6 GitHub Linebreak Repair
 Originally Posted by dday9
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.
-
Dec 16th, 2023, 11:58 AM
#5
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.
-
Jan 30th, 2025, 06:32 AM
#6
Re: VB6 GitHub Linebreak Repair
Essential tool for all VB6ers using github.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Jan 30th, 2025, 06:41 AM
#7
Re: VB6 GitHub Linebreak Repair
 Originally Posted by yereverluvinuncleber
Essential tool for all VB6ers using github.
This or just use git client to fetch repos, not Download button.
I mean git clone https://www.github.com/user/repo from command line should work most of the time (always) unless local git config is bonkers.
cheers,
</wqw>
-
Jan 30th, 2025, 07:26 AM
#8
Re: VB6 GitHub Linebreak Repair
I always clone a repo. and that works for me. However, some do not, resulting in the raising of the issue after a download.
I executed the command line above
Code:
git config --global core.autocrlf true
and it went "in", we'll just have to see if it works with my next release.
I doubt I will ever become fully cognisant of the various git command line actions, so the desktop UI is what I use.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|