I am looking to create a dialog box that allows the user to enter numbers. However, I want them to enter a number for each file so thye dialog box needs to know how many files there is.
I am using the Pick directory to get the files and I store them in a variable.
Each file needs a number
Are you using application builder? If so, the answer might be a bit different. Here's an example of how you might do it:
folder = Pick Directory("Pick a folder");
files = Files in Directory(folder);
dlg = New Window("Assign Numbers",
V List Box(
text box("Assign numbers to each file"),
fileList = Lineup Box(2),
Button Box("OK")
)
);
for(i = 1, i<= N Items(files), i++,
fileList << Append(
textbox(files[i])
);
Eval(Parse(Eval Insert(
"filelist << Append( file_num_^i^ = Number Edit Box())"
)))
);In the end, you will have a number edit box with variable names file_num_1, file_num_2, etc. so you can iterate through each number edit box to grab the values and store them when the user presses "OK".