HideousKojima
❔ Proper way to do something in C# (migrating an old Visual Basic library)
Well I might be able to avoid using sizeof() entirely here. Turns out they were using that to calculate the byte number in the file to start the write at (using the old VB FileSystem.FilePut() method). Should be easy to do it cleaner and better with a Stream.
Thanks for the help in figuring out what the hell they were doing in the first place haha
48 replies
❔ Proper way to do something in C# (migrating an old Visual Basic library)
That's right, they took a string, converted it to an integer (it was the old Conversions.ToInteger, I already changed that), then convert it to a char, then back to a string
48 replies
❔ Proper way to do something in C# (migrating an old Visual Basic library)
Guess I'd better find out if the stuff that depends on this is 32-bit or 64-bit, and if we can even change that without breaking all of the data that has already been stored
48 replies
❔ Proper way to do something in C# (migrating an old Visual Basic library)
Pretty much yeah, most of this appears to have been originally in VB6, I've found a bunch of comments left behind by an automatic VB6 to VB.NET conversion tool they used on it probably 20 years ago
48 replies
❔ Proper way to do something in C# (migrating an old Visual Basic library)
I wish it was black magic, it's definitely more spaghetti code here lol. A good chunk of what this library is doing is reading binary data from some files and databases, converting it to strings to use/manipulate/whatever (and ASCII only, I might need to add proper support for unicode) and then converting it back to byte arrays and saving it. They chose some of the most convoluted ways imaginable to do this though lol
48 replies