Buongiorno,
ho un interfaccia creata su movicon a cui dovrei aggiungere tramite script la possibilità di manipolare un file .csv
il programma gira su un TD410
Sub Main()
Dim fo
Dim mode
Const NEU=0
Const delimiter=";"
Const gap=""
Const path = "\My Documents\log_4.csv"
mode=8
Set fo= CreateObject("FileCtl.Filesystem")
fo.Open path,mode
If fo.LOF = NEU Then
fo.LinePrint("intestazione")
End If
fo.LinePrint("test record")
fo.Close
Set fo = Nothing
End Sub
l'avvio dello script mi genera l'errore seguente:
line 12, offset 0
ActiveX automation: server could not be found
ho testato anche il seguente script:
Sub Main()
Dim filePath As String
Dim contentToWrite As String
filePath = "\My Documents\log_114.csv"
contentToWrite = "prova"
' Apri il file per la scrittura
Open filePath For Output As #1
' Scrivi il contenuto nel file
Print #1, contentToWrite
' Chiudi il file
Close #1
End Sub
in questo secondo caso non ho nessun errore visualizzato, ma il file mi rimane comunque vuoto
script movicon manipolare file csv o txt
-
- Moderatore
- Posts: 1666
- Joined: 29/10/2010, 10:09
- Contact:
Re: script movicon manipolare file csv o txt
Salve,
se il suo scopo è di scrivere alcune righe in un file di testo, in allegato uno script di esempio.
se il suo scopo è di scrivere alcune righe in un file di testo, in allegato uno script di esempio.
You do not have the required permissions to view the files attached to this post.