No OpenStack ..... ! continued
Francis Nugent Dixon
effendi at wanadoo.fr
Sat Mar 4 15:23:00 EST 2006
Hi Jacqueline,
You wanted my "openStack" script, so here it is.
But I can't see anything in there that can cause
a problem. I hope it is easy to read with the folding.
It works perfectly well when I type "OpenStack" in the
message box (on my Mac).
Thanks for looking.
-Francis
------------------------------------------------------------------------
--------------------
on openStack
--
-- This is a standard "OpenStack" for all my stacks. It makes
available certain global
-- variables which may be used if required within the stack. As
many of my stacks use
-- data files, photo files and print files, global variables are
available for certain
-- folder paths and files, and are stored in standard fields on
card 1 of the stack, IF
-- those fields are present. As the stack can be run on a Mac or
a PC, a platform identity
-- is stored in a standard field on card 1 of the main stack, IF
this field is present.
--
global
GVThisPlatform,GVStackName,GVStackLanguage,GVStackPath,GVSuffixPath
global GVImpExpFileName,GVDataPath,GVPhotoPath,GVPrintFileName
--
-- V1 - 2006/02/03 - 13:50 - Creation for DreamCard - extended
from HyperCard.
-- V2 - 2006/02/09 - 22:30 - Added new Folder Paths.
-- V3 - 2006/02/17 - 12:53 - Changed English/French value to 1/2
(and not 0/1)
-- This will allow me to access English
or French error messages,
-- and to set English or French labels,
if required.
-- V4 - 2006/02/17 - 16:00 - Simplified Global Folder Path
definitions.
-- V5 - 2006/03/03 - 18:00 - Removed from trial "MyHomeStack" and
placed in all stacks.
-- (MyHomeStack didn't satisfy me, so I
dropped the idea !).
-- V6 - 2006/03/04 - 15:15 - Created global variables for Data,
Photo and Print folders and files.
--
-- This script initializes all of my Global Variables.
--
-- 1 - Set current platform Global Variable
--
put the platform into LVHoldPlatform
if LVHoldPlatform = "MacOS" then put "Mac - OS X" into
GVThisPlatform
if LVHoldPlatform = "Win32" then put "PC - Windows" into
GVThisPlatform.
--
-- 2 - Get the Stack Name.
--
put the short name of this stack into GVStackName
--
-- 3 - Set Language - Assume English when loading stack
--
put 1 into GVStackLanguage
--
-- 4 - Fill field "MyPlatform" in card 1 of mainstack, if it
exists.
--
if exists(field MyPlatform) then put GVThisPlatform into field
MyPlatform of card 1 of stack GVStackName
--
-- 4 - Set my Revolution Paths. These are similar to my Hypercard
paths but point to my Revolution
-- folders, which are identical in levels and names, on both
the Mac and the PC.
-- Note that (for some reason) the Disk element (Tradition/
or C:\) does not form part of the path.
--
if LVHoldPlatform = "MacOS" then
put "/Revolution/" into GVStackPath
put ".hc" into GVSuffixPath -- Set
up my Mac suffix for text files.
-- -- The
.hc suffix on MY Mac system opens Microsoft Word.
end if
if LVHoldPlatform = "Win32" then
put "\Revolution\" into GVStackPath
put ".txt" into GVSuffixPath -- Set
up my PC suffix for text files.
end if
put GVStackPath & GVStackName & "/Print/ImpExp.hc" into
GVImpExpFileName
put GVStackPath & GVStackName & "/Data/" into GVDataPath
put GVStackPath & GVStackName & "/Photos/" into GVPhotoPath
put GVStackPath & GVStackName & "/Print/" & GVStackName &
GVSuffixPath into GVPrintFileName
--
-- Now store these variables into card 1 fields, if they exist.
--
if exists(field MyImpExpFileName) then put GVImpExpFileName
into field MyImpExpFileName
if exists(field MyDataFolderName) then put GVDataPath
into field MyDataFolderName
if exists(field MyPhotosFolderName) then put GVPhotoPath
into field MyPhotosFolderName
if exists(field MyPrintFileName) then put GVPrintFileName
into field MyPrintFileName
end openStack
More information about the use-livecode
mailing list