04-12-2019 04:04 AM
Hi,
I'm working with DIAdem 2017
I would create a SaveDialog and name my file with variabel "sPath". I created saveDialog, but I do not know, how to name my file. Can anyone help me?
many thanks
FileDlgFilt = "ASCII Import (*.xlsx),*.xlsx"
If (FileNameGet ("ANY", "FileWrite",DataReadPath, FileDlgFilt, , , "Data selection")="IDOk") then
Dim sFullName,n,m,sPath,fso
sFullName= EditBox1.Text
n = InStrRev(sFullName, "\")
m= InStrRev(sFullName, ".")
sPath =mid(sFullName,n+1,m-n)
GetName = GetFileName(sPath)
04-15-2019 05:07 PM
This looks like code from a dialog box? You could post a more complete code snippet from your function as well as a screenshot of your dialog box to give more information about the issue
04-16-2019 02:38 AM
my program consists of 2 Button and 2 EditBox. I click on Button1 opendioalog will open and I choose a file then. the name of the file is shown in Editbox1. then I click on Button2 and savedialog will open and I have to enter a name. here I want, the name of EditBox1 is transferred to filename field in SaveDialog.
Sub Button2_EventClick (ByRef This) 'EditBox1(Input Opendialog)...............
FileDlgFilt = "ASCII Import (*.mf4;*.dat),*.mf4;*.dat"
if ( FileNameGet("ANY", "FileRead", DataReadPath, FileDlgFilt, , , "Data selection")="IDOk") then
EditBox1.Text= FileDlgFileName
Else
Call MsgBoxDisp ("Keine Datei ausgewählt.")
End if
End Sub
Sub Button3_EventClick(ByRef This) 'EditBox2(Output saveDialog) .......................
Dim sFullName,n,m,sPath
FileDlgFilt = "ASCII Import (*.xlsx),*.xlsx"
If( FileNameGet ("ANY", "FileWrite",DataReadPath,fileDlgFilt,,,"Datei Speichern")= "IDOk") Then
sFullName= EditBox1.Text
n = InStrRev(sFullName, "\")
m = InStrRev(sFullName, ".")
sPath =mid(sFullName,n+1,(m-1)-n)
EditBox2.Text= Spath
Else ' Kein Speicherort ausgewählt
Call MsgBoxDisp ("Kein Speicherort ausgewählt.")
End if
End Sub
04-16-2019 02:40 AM
Foto von Dialog
04-17-2019 01:33 PM
Would it be easier to use PathNameGet() to get the path for editbox1 and once you have the path and click the second button, you just get the filename fro the user with InputBox()?
04-18-2019 03:10 AM
thank you for Replay. I could find the Code