open DMP File

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
nobaday
Posts: 36
Joined: Mon May 09, 2011 3:23 pm

open DMP File

Post 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!
nobaday
Posts: 36
Joined: Mon May 09, 2011 3:23 pm

Re: open DMP File

Post 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!
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: open DMP File

Post 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
nobaday
Posts: 36
Joined: Mon May 09, 2011 3:23 pm

Re: open DMP File

Post by nobaday »

Worked beautifully, thanks Klaus!
Post Reply