Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass file in vb programme.

Status
Not open for further replies.

Sasquatch69

Programmer
Sep 20, 2002
19
CA
Hi,
i got a little problem. I made a Script in VB(not vbscript) who convert some caractere in a text file

My code:
Private Sub Main()
Dim temp As Byte
Open "D:\input.txt" For Binary As #1 Open "D:\output.txt" For Binary As #2
While Not EOF(1)
Get #1, , temp
If (temp = 59) Then 'if " ; "
temp = 138 ' replace by " è "
Put #2, , temp
ElseIf (temp = 61) Then
temp = 147 ' replace by " ô "
Put #2, , temp
ElseIf (temp = 58) Then ' :
temp = 133 ' replace by " à "
Put #2, , temp
ElseIf (temp = 62) Then
temp = 130 ' replace by " é "
Put #2, , temp
Else
Put #2, , temp
End If
Wend
' close file
Close #1
Close #2
End Sub

Now my problem is, I don't know how to pass a file to my application!! I make a .exe with this programme, and i need to create a exe application for every files i need to convert. How can i pass a variable(c:\newfile.txt) to a EXE???

Thanks

(sorry for my bad english)
 

check the command$ string:
-------------------
Private Sub Main()
msgbox "Input parameter: '" & command$ & "'"
end sub
-------------------

MyProg.exe InputParaGoesHere Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Hi,

If i did understand, your problem, is to pass to an EXE, the path of a file to be read!

If so, you only have to access the COMMAND system var.
if your command line is

READLN.EXE "c:\Test.txt"

your Command var will be

"c:\Test.txt"

See your VB (MSDN) help on this matter!


I hope this helps.
Carlos Paiva
 
THank you very much Sunaj

It work perfectly. thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top