Confused

Francis Nugent Dixon effendi at wanadoo.fr
Thu Nov 20 06:46:03 EST 2008


Hi from Paris,

Jo, I had this problem early on and decided to develop a standard  It  
may look a tad heavy at first, but I have build lots of stacks with  
external files (music, photos, data, etc.). I have never regretted  
making this decision. You can always strip the idea down to what you  
need.

I have a folder standard :

Revolution
     Folderforstackswithnoexternalfiles
     Models
     StackName1
         Data     -- .txt files usually, especially 2 data bases - see  
below)
         Music    -- .MP3 files only - I suppose you can use .aif  
files, but they are so heavy !
         Photos   -- .jpg files
         Program  -- .rev file
         Documentation -- Anything I might want to pass on to the User.
         Backups -- .txt file backups of the Data base BEFORE each  
execution.
     StackName2
         Data

        etc.

Any stack with no external file goes into the folder  
"Folderforstackswithnoexternalfiles" Choose the name you want.
When I create a new stack, I try to base it on one of the many models  
that I have in my "Model" folder. ........   Otherwise, it becomes a  
new model.
For any stacks with external files, I create a complete set of  
subfolders (whose names are always the same) under a subfolder which  
has the name of the stack. I NEVER deviate from this rule, even if  
some of my stacks don't need some of the subfolders. Empty folders  
dont take up much space :) I usually add a "Read-Me" file to each of  
the subfolders, to explain to my user how the files of the folder are  
used.

I put an absolutely standard openStack script in ALL my stacks (even  
if they don't have external files). Depending on the needs of each  
stack, I can add unique commands at the end of the standard script. In  
various scripts throughout the rest of the stack, I make available  
whichever global variables I need from the Openstack script.  
Obviously, they never change during execution. I have "Language"  
buttons in most of my stacks. Click a button and all the labels and  
messages change to the new language (I have family in 4 continents !)

As a result, whatever I need for any type of stack is always  
available.  If I add new functions to the stack later on, the  
infrastructure is already there.

Since I moved to 3.0 recently, I also use this setup for standalone  
Rev stacks, and the "Data" subfolder now also contains the exported  
Data Bases to be loaded into the standalone stack. I have standard  
Export and Import scripts for use in a standalone environment. I  
create one data base for each platform (Mac or PC).  When I have built  
my stack, I export the contents to the data bases, empty the stack and  
save the .rev file to the "Program" Folder. When I move the folder  
subset to another platform (The folder subset will go into the  
"Revolution" folder which I create the first time). All I have to do  
is to create an alias of the .rev app and move it to the deskTop.

BTW, I use GVxxx for global variable names, and LVxxx for local  
variables.

Best Regards

-Francis

OpenStack script follows : (be careful of wraparounds !)

on openStack
   --
   global GVThisPlatform,GVStackName,GVStackPath,GVStackLanguage
   global  
GVDataPath 
,GVMusicPath 
,GVPhotosPath,GVPrintPath,GVProgramPath,GVBackupPath,GVDeskTop
   --
   --     1 - Identify current platform and set a few global variables.
   --
   put the platform into LVHoldPlatform                     -- Get the  
Machine Platform.
   if LVHoldPlatform = "MacOS" then                         -- Is it a  
Mac ?
     put "Mac" into GVThisPlatform                          -- Show it  
is a Mac.
     put "/Revolution/" into GVStackPath                    -- Set Mac  
StackPath Header.
   end if
   if LVHoldPlatform = "Win32" then                         -- Is it a  
PC ?
     put "PC" into GVThisPlatform                           -- Show it  
is a PC.
      put line 1 of the volumes into LVPCID                 -- Pick up  
PC Systems Disk Drive ID.
     put LVPCID & "/Revolution/" into GVStackPath           -- Set PC  
StackPath Header with Disk ID.
   end if
   --
   put 1 into GVStackLanguage                               -- Set  
Language - Assume English when loading stack.
   --
   --     2 - Set my Revolution Paths. These point to Revolution  
folders which are identical in levels and names, on both
   --         the Mac and the PC. I use here "GVStackPath" and  
"GVStackName" which have previously been initialized.
   --
   --         Note that (for some reason) the Disk element on a Mac  
does not form part of the path. On the PC, it is usually "C:"
   --
   put GVStackPath & GVStackName & "/Data/"      into GVDataPath
   put GVStackPath & GVStackName & "/Music/"     into GVMusicPath
   put GVStackPath & GVStackName & "/Photos/"    into GVPhotosPath
   put GVStackPath & GVStackName & "/Print/"     into GVPrintPath
   put GVStackPath & GVStackName & "/Program/"   into GVProgramPath
   put GVStackPath & GVStackName & "/Multiples/" into GVMultiplesPath
   put GVStackPath & GVStackName & "/Backups/"   into GVBackupPath
   put specialFolderPath("DeskTop")              into GVDeskTop
   --
   --     Some of my stacks have a header card (card 1) where I show  
information, if the reception fields exist.
   --
   if exists(field MyDataPath) then put GVDataPath           into  
field MyDataPath
   if exists(field MyMusicPath) then put GVMusicPath         into  
field MyMusicPath
   if exists(field MyPhotosPath) then put GVPhotosPath       into  
field MyPhotosPath
   if exists(field MyPrintPath) then put GVPrintPath         into  
field MyPrintPath
   if exists(field MyProgramPath) then put GVProgramPath     into  
field MyProgramPath
   if exists(field MyBackupPath) then put GVBackupPath     into field  
MyBackupPath
   if exists(field MyPlatform) then put GVThisPlatform into field  
MyPlatform of card 1 of stack GVStackName
   --
   -- 
******************************************************************************************************************************
   --
   --     The following section is valid only for this specific  stack.
   --
   -- 
******************************************************************************************************************************
   --
end openStack





More information about the use-livecode mailing list