Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: mjzrpr on July 21, 2021, 04:10:56 AM
-
hello
I want save DRO in the external file but keep first line. when read first line and write to new file. it saved by added "".
For example the first line( that want keep it) is screw01. after running code 5 time the first line is """""screw01""""".
how to remove "". thanks
Dim fich As String
Dim FileData As String
fich="offset_"&GetUserDRO(1000)&""
If Dir(fich)="" Then
MsgBox fich&&" not found"
Else
Open fich For Input As #1
Line Input #1, FileData
namedesc=FileData
Close #1
End If
Open fich For Output As #2 ' Open to write file.
Write #2, (namedesc) 'problem
For x = 1000 To 2255
DROState = GetUserDRO(x)
Write #2, DROState
Next x
Close #2
Message "save done!"
-
try to use this:
namedesc = Mid(FileData,2,Len(fileData)-2)
-
thank you TPS. it works well by your code. :)