Home > Software engineering >  How to use VB (not VBA) implementation of Unix format TXT to Dos format conversion
How to use VB (not VBA) implementation of Unix format TXT to Dos format conversion

Time:12-22

Consult everybody masters, how to use VB (not VBA) realization of Unix format TXT to Dos format conversion, hope to be able to help provide code, thank you!

CodePudding user response:

Not to, only supplies the reference:
 Dim as Byte b 
Dim As Long I
Dim ln As Long
Open "DOS. TXT" for binary access read as # 2
Open "Unix. TXT" for binary access read as # 1
LLN=LOF (1)
For I=1 to ln
B=inputB # (1, 1)
Put # 2, and b
If b=vbCr then Put # 2, and vbLf
Next
Close # 1
Close # 2

CodePudding user response:

On line 4
Open "DOS. TXT" for binary access read as # 2
Should be changed to
Open "DOS. TXT" for binary access write as # 2

CodePudding user response:

Line 6
LLN=LOF (1)
Should be changed to
Ln=LOF (1)
  • Related