Kinda confused

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
stuartls
Posts: 49
Joined: Mon Jan 22, 2007 10:59 pm
Contact:

Kinda confused

Post by stuartls » Mon Mar 05, 2007 1:36 am

I am in the process of developing a revolution program. Every one of my cards imports an image. I want to be able to save the program to a CD rom and then once my students get the CD rom to be able to install the standalone program onto their computer. Or maybe even just run off of the CD rom. In developing this program on my "C" drive what folder or drive do I save all my work in? The reason i ask this is that I do not want to go back and have to recode every card to find the image once the program is in final stage and saved to the CD rom since it has been developed and saved on my "C" drive. Does Revolution allow for this? The other question is can I have the program operate just like a new program, meaning can a student get the CD and it runs thru all the appropriate questions to install it on their C drive and then it is standalone on their drive? Other password questions and anti-copy questions to come after I get myself clear on this on.

Stu

marielle
Livecode Opensource Backer
Livecode Opensource Backer

Re: Kinda confused

Post by marielle » Mon Mar 05, 2007 3:03 pm

Hi Stuart,

It looks like what you need is to declare all your files by reference to where the stack with your application is. To do so,

Code: Select all

function path.topstack
  put (the effective filename of the topstack) into tPath
  set the itemDelimiter to "/"
  if the number of items in tPath > 1 then
    return item 1 to -2 of tPath
  else 
    return item 1 of tPath
  end if
end path.topstack
You can then reference all your files relative to this path.topstack() value

Code: Select all

put ("file:" & path.topstack() & "/" & "subfolder/" & "file.ext") into tURL
put tFileContent into URL tURL
put URL tURL into tFileContent
or you can use the set default folder construct to set this one as your active directory.

Code: Select all

set the defaultfolder to path.topstack()
put ("file:" & "subfolder/" & "file.ext") into tURL
put the files
put the folders
Marielle

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”