To all VB Guru out there - Please give me a hand in writing this code....
Below is a detailed explanation of what we need to accomplished with VB or even PERL....
I need to open, save and close 1200 very short files. They are strictly text files to be used in CNC machines, as job code for cutting metal on lathes.
When we transfer them to the machines, they won't run unless we have already opened them and saved them. We do not want to make any changes at all.
I can open a file in notepad, save it as the same name, and then close it. Then the machine will read it. I just have 1200 to do at a time.
Is there a way to automate this using VB or even PERL
to open the files (1200) close it...(no changes will be made to the files,
just a open and close for the file format specified...the server needs
to see that the file was open inorder to process the jobs....) I could not get the code to do what I want..
---------- Current VB Code --------------
Dim varpart As Variant
Dim strpart As String
Dim strname As String
Dim fso As FileSystemObject
Dim intoutput As Integer
Dim intreal As Integer
Private Sub Command1_Click()
varpart = 54000
intoutput = 1
intreal = intoutput + 1
Do Until (varpart = 55120)
varpart = varpart + 1
strpart = CStr(varpart)
strname = "c:\A" & strpart & ".min"
Open strname For Output As #intreal
Close intreal
Loop
End Sub
---------- End Code -----------------------
Thanks,
Ant
Below is a detailed explanation of what we need to accomplished with VB or even PERL....
I need to open, save and close 1200 very short files. They are strictly text files to be used in CNC machines, as job code for cutting metal on lathes.
When we transfer them to the machines, they won't run unless we have already opened them and saved them. We do not want to make any changes at all.
I can open a file in notepad, save it as the same name, and then close it. Then the machine will read it. I just have 1200 to do at a time.
Is there a way to automate this using VB or even PERL
to open the files (1200) close it...(no changes will be made to the files,
just a open and close for the file format specified...the server needs
to see that the file was open inorder to process the jobs....) I could not get the code to do what I want..
---------- Current VB Code --------------
Dim varpart As Variant
Dim strpart As String
Dim strname As String
Dim fso As FileSystemObject
Dim intoutput As Integer
Dim intreal As Integer
Private Sub Command1_Click()
varpart = 54000
intoutput = 1
intreal = intoutput + 1
Do Until (varpart = 55120)
varpart = varpart + 1
strpart = CStr(varpart)
strname = "c:\A" & strpart & ".min"
Open strname For Output As #intreal
Close intreal
Loop
End Sub
---------- End Code -----------------------
Thanks,
Ant