Page 1 of 1

open DMP File

Posted: Wed Dec 23, 2015 6:58 pm
by nobaday
HI
Very basic question (I hope).

I need to create an open button which opens a .DMP file (which is just a text file from a database dump)
and place it into a text field.

I was having two issues, now to limit the section to .DMP files, then how to get that into the text field.

thanks!

Re: open DMP File

Posted: Wed Dec 23, 2015 7:42 pm
by nobaday
I should add, the .DMP file is just a text file, but it would be nice to limit the user to that extension when they chose a file. thanks!

Re: open DMP File

Posted: Wed Dec 23, 2015 7:48 pm
by Klaus
Hi nobaday,

do like this:

Code: Select all

...
answer file "Select a DMP file:" with type "DMP file|dmp|"

## User might have clicked CANCEL, but the selcted file pathname is in the variable IT
if it <> empty then

  ## Read file as TEXT and put its content into a field:
  put url("file:" & IT) into fld "your field here..."
end if
...
Best

Klaus

Re: open DMP File

Posted: Wed Dec 23, 2015 9:29 pm
by nobaday
Worked beautifully, thanks Klaus!