FLC_IDE: - and about stackfiles

MisterX b.xavier at internet.lu
Thu Sep 30 10:47:45 EDT 2004

Thanks for the credits ;)

You could also add the dynamicpaths, stackfiles, and the older hyperCard
related properties. This would be nice to know why we get some different
behaviors in different stacks...


Everyone try this in the message box:
The stackfiles of stack home

(in hyperCard you could say of home ;))

Don't try this: 
go [stack] home

Im rather disappointed that it is this way that paths are implemented...
Was the old globals stacks,documents,applications so bad?

I know, "stacks" returns the list of opened stacks...

We don't have the required RR path clutter but beyond that...
I see no reason why we can't implement them again right?

Opinions are welcome!


-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of
FlexibleLearning at aol.com
Sent: Thursday, September 30, 2004 1:03 PM
To: use-revolution at lists.runrev.com
Subject: FLC_IDE: A combi-function for stack environment info

Several rather useful handlers have been posted to identify various aspects
of a stack's operating environment, so I thought to combine them in a single
function for your Scripter's Scrapbooks. The below should copy and paste
correctly as monospaced, but do watch for line wraps!

example: put  FLC_IDE()
example: get FLC_IDE(sys,plat,vers)
example: get FLC_IDE(v,e,p)
example: if "dev" is in FLC_IDE(env)  then...
The options can be shortened to a single letter and put in any order, and
will be returned in the same order as requested.
Uses: switch, paramCount, params, format, try/catch, do as  AppleScript
on mouseUp
put FLC_IDE  (p,e,s)
end mouseUp
--|  Author:          Hugh Senior, based  on ideas by Ken Ray, Scott Rossi 
and Xavier Bury
--|  Version:         1.0
--|  Created:         30-SEP-2004
--| Last  Mod:        --
--|  Requires:        Self-contained function  handler for Revolution and 
--|  Summary:
--|     Returns any combination of the platform,  system version, 
--|     application type, engine  version, build number, and environment
--|     in a  return-separated list
--| Parameters:
--|      None (for full list), or
--|     Any combination of  P[latform], S[ystemVersion],  A[pplication],
--|                         V[ersion], B[uild], E[nvironment]
--|     Example: get  FLC_IDE() - Returns all 6 lines
--|     Example: get  FLC_IDE(A,V,P) - Returns Application, Version and
--|     xample: get FLC_IDE(plat,e,s) - Returns  Platform, Envt and Sys 
--| Vers
--| Returned  values:
--|     Values will be one per line, in the same  order as requested...
--|     Platform: Windows 95,  Windows 98, Windows ME, Windows NT, 
--| Windows
--|                Windows XP, Mac OSX, Mac Classic, Mac OS9, Linux
--|      SystemVersion: Your computer OS version
--|      Application: MetaCard, Revolution
--|     Version: Engine  version
--|     Build: Engine build  number
--|     Environment: Development, Helper  Application, Standalone
--|                   [or Player], [or  Plug-In]
function FLC_IDE
local  tPlatform,tSystemVersion,tApp,tVersion,tBuild,tEnvt
  # Platform: Windows 95, Windows 98, Windows ME, Windows NT, Windows  2000,
Windows XP...
if the platform is "Win32"  then
put word 2 of the systemVersion into  tSystemVersion if word 1 of the
systemVersion = "Windows"  then # set the shellcommand to  "command.exe"
case tSystemVersion>=4 and  tSystemVersion<4.1 put "Windows  95" into
tPlatform break case tSystemVersion>=4.1 and  tSystemVersion<4.9 put
"Windows  98" into tPlatform break case  tSystemVersion>=4.9 put  "Windows
ME" into tPlatform end  switch else # set the  shellcommand to "cmd.exe"
case tSystemVersion>=4 and  tSystemVersion<5 put "Windows  NT" into
tPlatform break case tSystemVersion>=5 and  tSystemVersion<5.1 put "Windows
2000" into tPlatform break case  tSystemVersion>=5.1 put  "Windows XP" into
tPlatform end  switch end if

else if the  platform is "MacOS" then
# Platform: Mac OSX, Mac Classic,  Mac OS9 put the systemVersion into
tSystemVersion set the itemDel to  "."
if item 1 of tSystemVersion >= 10  then
put "Mac OSX" into  tPlatform
put  format("tell app \"Finder\"\the processes\tell") into  tAS do tAS as
AppleScript put format("process \"Classic  Support\"") into tClassicProcName
if (the  result contains tClassicProcName)  then put "Mac Classic" into
tPlatform else put "Mac OS9" into  tPlatform end if else #  Platform: Linux
put "Linux" into tPlatform end  if

# Application: Revolution, MetaCard
# Version:  [number]
# Build: [number]
put the buildNumber into  tBuild
put revAppVersion() into  tApp
catch errorVar
put "MC" into tApp
end try
if (tApp is "MC") OR (tVersion is 0)  then put the version into tVersion put
"MetaCard" into tApp else put "Revolution" into tApp

# Environment: Development, Helper Application, Standalone  Application [or
Player], [or Plug-In] put the environment into  tEnvt

if the paramCount is 0 then
return tPlatform &CR&\
tSystemVersion  &CR&\
tApp &CR&\
tVersion &CR&\
tBuild  &CR&\
local temp
repeat with n=1 to the  paramCount
switch char 1 of  param(n)
case  "P"
put tPlatform &CR after  temp break
case  "S"
put tSystemVersion &CR  after temp break case  "A"
put tApp &CR after temp  break
case  "V"
put tVersion &CR after  temp break
case  "B"
put tBuild &CR after temp  break
case  "E"
put tEnvt &CR after temp  break
end switch
end  repeat
if last char of temp is CR then delete last char of  temp return temp end if

The Flexible Learning Company
Home of The Scripter's  Scrapbook
www.flco.co.uk (note the new shorter web address shortcut)
use-revolution mailing list
use-revolution at lists.runrev.com

More information about the use-livecode mailing list