Using the 'effective filename' function

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
louisharrodine
Posts: 7
Joined: Tue Oct 30, 2012 11:39 am

Using the 'effective filename' function

Post by louisharrodine » Tue Feb 19, 2013 11:22 am

Hi there,

at the moment, this is my code:

Put effective filename of this stack & "/Records.txt" into Filedirectory

which puts C:/livecodethings/todo.livecode/Records.txt into the variable 'Filedirectory'

I want it to put : C:/livecodethings/Records.txt into the variable 'Filedirectory'
so I can store the file "Records.txt." in the same folder as the program.


Any help?

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Using the 'effective filename' function

Post by Dixie » Tue Feb 19, 2013 11:39 am

Hi...

Code: Select all

on mouseUp
   set itemDel to "/" 
   set the defaultfolder to item 1 to -2 of (the effective fileName of this stack)
   
   put the defaultfolder & "/records.txt" into filePath
   put "Hello" into URL("file:filePath")
end mouseUp
be well

Dixie

louisharrodine
Posts: 7
Joined: Tue Oct 30, 2012 11:39 am

Re: Using the 'effective filename' function

Post by louisharrodine » Tue Feb 19, 2013 11:45 am

Thanks a lot for your reply - just put it all in, and it's working perfectly.

Thanks again.

Post Reply