home *** CD-ROM | disk | FTP | other *** search
/ 1&1 Multimedia Trend 1996 10 B / MM_TREND.ISO / prog / t-online / shared.dir / 00303_Script_303 < prev    next >
Text File  |  1996-08-16  |  4KB  |  178 lines

  1. -- System
  2.  
  3.  
  4. -- Parts from: MovieUtilities XObject/DLL Example Movie,
  5. -- v. 1.0.7 for MS Windows 3.1 (7/25/94)
  6. -- by David Jackson Shields
  7. -- ⌐ 1994 by Macromedia, Inc.
  8. -- Provides utility functions not yet in Director.
  9.  
  10. on InitSystem
  11.   -- Machinen infos
  12.   -- Init die X-Libs
  13.   -- Filenames und PathNames
  14.   
  15.   
  16.   global gxUtilObj, gxFileObj, gxMsgObj
  17.   global gbIsPC
  18.   global gsWinPath, gsIniFile
  19.   global gsMoviePath
  20.   
  21.   --debug " ++++++++++++ check the machine ++++++++++++"
  22.   
  23.  
  24.   if not gbIsPC then
  25.     --alert "Diese Programm ben÷tigt Windows ⌐"
  26.     exit  
  27.   end if
  28.   
  29.   if (the colorDepth < 8) then
  30.     alert "Die Darstellung ist bei 16 Fraben nicht orginalgetreu!"
  31.   end if
  32.   
  33.   
  34.   -- ++++++++++++++ open x-libs +++++++++++++++++++
  35.   
  36.   -- --------- open the external factory ---------
  37.   --debug "open Util-lib .."
  38.   openXLib "MovUtils.DLL"
  39.   
  40.   -- create the object in RAM:
  41.   if objectP( gxUtilObj ) then gxUtilObj( mDispose )
  42.   put MovUtils( mNew ) into gxUtilObj
  43.   
  44.   put value( gxUtilObj ) into result
  45.   if result < 0 then
  46.     Fehler result, "Das Modul: movutils.dll ist nicht vorhanden!" 
  47.     exit
  48.   end if
  49.   --debug "is ok"
  50.   
  51.   -- ---------------- open file IO ------------
  52.   --debug "open FileIO"
  53.   openXLib "fileio.DLL"
  54.   -- create  object
  55.   if objectP( gxFileObj ) then gxFileObj( mDispose )
  56.   --debug "is ok"
  57.   
  58.   
  59.   -- ---------------- open Message Exchange ------------
  60.   --debug "open caw"
  61.   openXLib "cawXobj.DLL"
  62.   -- create  object
  63.   if objectP( gxMsgObj ) then gxMsgObj( mDispose )
  64.   
  65.   
  66.   --debug "is ok"
  67.   
  68.   -- ----------------- set the path ---------------
  69.   GetVolName
  70.   GetWinPath -- 1ter Aufruf holt win path fⁿr ini files
  71.   set gsMoviePath = the PathName
  72.   --debug "MoviePath: " & gsMoviePath
  73.   
  74.   
  75.   
  76. end InitSystem
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. -- *************************************************
  84.  
  85. on ClearSystem  
  86.   -- on stop clean up the mess
  87.   
  88.   global gxUtilObj, gxFileObj, xMsgXobj
  89.   
  90.   if objectP( gxUtilObj ) then gxUtilObj( mDispose )
  91.   if objectP( gxFileObj ) then gxFileObj( mDispose )
  92.   if objectP( gxMsgObj ) then gxMsgObj( mDispose )
  93.   
  94.   closeXLib  -- alle!!
  95. end ClearSystem
  96.  
  97.  
  98.  
  99.  
  100.  
  101. on getVolName
  102.   -- extract volume name from a given path name string:
  103.   
  104.   global gxUtilObj, gsX, gsIniFile
  105.   
  106.   if objectP( gxUtilObj ) then
  107.     put gxUtilObj( mGetVolName, the pathName ) into gsX
  108.   else
  109.     Fehler 101, "--"
  110.   end if
  111.   -- set gsIniFile = gsWinPath & "\" & gsIniFile
  112.   --debug "Volume: " & gsX
  113.   
  114. end getVolName
  115.  
  116.  
  117. on getSysPath
  118.   -- returns complete volume and pathName of currently active System folder
  119.   -- as a string. NOTE: This is the DOS System directory.
  120.   
  121.   global gxUtilObj, gsSysPath
  122.   
  123.   if objectP( gxUtilObj ) then
  124.     put gxUtilObj( mGetSystemPath ) into gsSysPath
  125.   else
  126.     Fehler 101, "--"
  127.   end if 
  128.   
  129. end getSysPath
  130.  
  131.  
  132.  
  133. on getWinPath
  134.   -- returns complete volume and pathName of currently active 
  135.   -- Windowsfolder as a string...useful for creating/opening Prefs:
  136.   
  137.   global gxUtilObj, gsWinPath, gsIniFile
  138.   
  139.   if objectP( gxUtilObj ) then
  140.     put gxUtilObj( mGetWindowsPath ) into gsWinPath
  141.   else
  142.     Fehler 101, "--"
  143.   end if
  144.   --debug "Winpath:" & gsWinPath
  145.   set gsIniFile = gsWinPath & "\" & gsIniFile
  146.   --debug "IniDatei: " & gsIniFile
  147.   
  148.   
  149. end getWinPath
  150.  
  151.  
  152.  
  153.  
  154. on setPath
  155.   -- Set the default pathName of "volume:\directory(s):" so that
  156.   -- with FileIO "?read" permission, the FileOpen/Save Dialog opens to the
  157.   -- specified folder.  This does not affect the Lingo pathName property.
  158.   
  159.   global gxUtilObj
  160.   
  161.   if objectP( gxUtilObj ) then
  162.     put field "volDirectory" into s
  163.     put gxUtilObj( mSetDefaultPath, s ) into result
  164.     if result = -1 then
  165.       alert "No such directory exists. Please try again..."
  166.       exit
  167.       
  168.     end if
  169.   else
  170.     Fehler 101, "--"
  171.   end if
  172.   
  173. end setPath
  174.  
  175.  
  176.  
  177.  
  178.