Is there anyway to create an open file dialog in Rumba Script that will return the Path and Filename into a Variable? I have some scripts that use data from a text file to drive the main loop of the script. Currently I just hand type the info into a text box using the dialog system. I am going to start sending these to end users to run and was hoping to be able to implement something a little more user friendly.
#RumbaTry this ...
Sub Main
Dim i As Integer Const ArrTop As Integer = 100 ' limit to 100 files, and that is way too many Dim MyArray(ArrTop) As String Dim strDrive As String
'strDrive="C:\\" 'specify the needed path here file_name = Dir$(strDrive & "\\*.*", vbDirectory)
MsgBox file_name
i = 1 Do While (Len(file_name) > 0) And (i < 101)
' See if we should skip this file. If Not (file_name = ".") Or (file_name = "..") Or (file_name=" ") Then MyArray(i) = file_name i = i 1 End If
' Get the next file. file_name = Dir$()
Loop
Begin Dialog DlgExample 30,35,169,151, "Dialog example" OKButton 104,24,40,14 CancelButton 104,44,40,14 PushButton 105,66,38,14, "Help", .Push1 ListBox 0,16,92,123, MyArray(), .LstBox End Dialog Dim DlgExampleVar As DlgExample Dialog DlgExampleVar
End Sub
Is there anyway to create an open file dialog in Rumba Script that will return the Path and Filename into a Variable? I have some scripts that use data from a text file to drive the main loop of the script. Currently I just hand type the info into a text box using the dialog system. I am going to start sending these to end users to run and was hoping to be able to implement something a little more user friendly.
#RumbaThis is close to what I was looking for. I think I might be able to adapt it. I was looking for a way to actually start at a drive's root and browse through the directories then find a file. This is a good starting point for me though, thanks. Also where does that Dir$ function come from? I do not see it listed in the F1 list of scripting commands in the editor.
Is there anyway to create an open file dialog in Rumba Script that will return the Path and Filename into a Variable? I have some scripts that use data from a text file to drive the main loop of the script. Currently I just hand type the info into a text box using the dialog system. I am going to start sending these to end users to run and was hoping to be able to implement something a little more user friendly.
#RumbaDir$ is a build in function
Dir[(path,attributes)]
It returns a file/directory name that matches the given path and attributes.
It is indeed not listed in the F1 list
See also: CurDir$