REVO2700Private2 X A--> all handlers -- Public functions: can be called from outside this stack script function volumeCylinder pHeight, pRadius put areaCircle(pRadius) into tArea return pHeight * tArea end volumeCylinder function volumeSphere pRadius put areaCircle(pRadius) into tArea return tArea * pRadius * 4 / 3 end volumeSphere function volumeCone pHeight, pRadius put areaCircle(pRadius) into tArea return tArea * pHeight / 3 end volumeCone -- Private function: can only called from inside this stack script private function areaCircle pRadius return pi * pRadius * pRadius end areaCircle -- Note: this stack script is changed whenever the 'Use private function' button is toggled -- therefore any changes you make to this script will not be saved. -- -- If the 'Use private function' button is toggled while this script is open -- in a script editor window, the script editor will no longer be correct -- and may overwrite the relevant script. -- -- If you are getting unexpected results, close the script editor and turn -- 'Use private function' off & on again to reset. fc,cPrivateScript.-- Public functions: can be called from outside this stack script function volumeCylinder pHeight, pRadius put areaCircle(pRadius) into tArea return pHeight * tArea end volumeCylinder function volumeSphere pRadius put areaCircle(pRadius) into tArea return tArea * pRadius * 4 / 3 end volumeSphere function volumeCone pHeight, pRadius put areaCircle(pRadius) into tArea return tArea * pHeight / 3 end volumeCone -- Private function: can only called from inside this stack script private function areaCircle pRadius return pi * pRadius * pRadius end areaCircle -- Note: this stack script is changed whenever the 'Use private function' button is toggled -- therefore any changes you make to this script will not be saved. -- -- If the 'Use private function' button is toggled while this script is open -- in a script editor window, the script editor will no longer be correct -- and may overwrite the relevant script. -- -- If you are getting unexpected results, close the script editor and turn -- 'Use private function' off & on again to reset. cGalaxyStartupFileX/Users/jerrydaniels/Documents/My Revolution Enterprise/Plugins/Galaxy Studio Startup.revcPublicScript"-- Public functions: can be called from outside this stack script function volumeCylinder pHeight, pRadius put areaCircle(pRadius) into tArea return pHeight * tArea end volumeCylinder function volumeSphere pRadius put areaCircle(pRadius) into tArea return tArea * pRadius * 4 / 3 end volumeSphere function volumeCone pHeight, pRadius put areaCircle(pRadius) into tArea return tArea * pHeight / 3 end volumeCone -- No longer a private function: can only called from anywhere function areaCircle pRadius return pi * pRadius * pRadius end areaCircle -- Note: this stack script is changed whenever the 'Use private function' button is toggled -- therefore any changes you make to this script will not be saved. -- -- If the 'Use private function' button is toggled while this script is open -- in a script editor window, the script editor will no longer be correct -- and may overwrite the relevant script. -- -- If you are getting unexpected results, close the script editor and turn -- 'Use private function' off & on again to reset. Private Uarial Warial$Warial ULucida GrandeULucida GrandeWLucida Grande ULucida Grande UArial UArialWArial UVerdanacREVGeometryCachestackID1048cGlx2TimeStamp0 1180103028working checksumY_!Qk;k 1180103185working 1180103906start 1180102376start 1180103188working 1186647869end 1180103602working 1180102944start 1180102154working 1180102235working 1180103991end 1180103598start 1180102870working 1186647732start 1180102873working 1186647822start 1180103537start 1180102962start 1180102730working 1180104035start 1180125320start 1180102733start 1180102175working 1180102489start 1186647984start 1180102181working 1180103386start 1180102031start 1180103551working 1180102580start 1180103393working 1180102899working 1180102829start 1180103325start 1180102202working 1180125262start 1180103563start 1186647851end 1180103174start 1180103570start 1180102842working 1180103024working 1180103735working 1180103573working 1180102926start 1186647859start 1180102998working cREVGeneral debugObjects breakpointsstackfileversionCard1 Pn-- initial setup on preOpenCard -- make sure the version of the stack script with the private handler is being used set the hilite of btn "Private" to true set the script of this stack to the cPrivateScript of this stack -- the library button script will not be in use, so turn off the checkbox set the hilite of btn "In use" to false end preOpenCard , cTopLeft522,314cREVGeometryCacheIDs1180074574650104411800750729791046118006878888310301180066309503102011800739379381038118006874880110281180074162961103911800666811901021118007383787310371180073709219103611800751058041047118006849541410261180074918893104511800751112531048cREVGeometrycachetotal14order  cGlxGeneral object nameCard1 parent stackPrivate immed stackPrivate hilitedLine7props

6basics

preview

-

blendLevel 0

-

ID 1002

name Card1

number 1

-

foregroundColor 0,0,0 [inherited]

backgroundColor 230,230,230 [inherited]

-

borderWidth 2

cantDelete false

-

4border

4colors

4patterns

4position

4size

4text

4custom [main]

4custom [cGlx2General]

4custom [cGlx2TimeStamp]

4custom [cGlxGeneral]

4custom [cREVGeneral]

4custom [cREVGeometrycache]

4custom [cREVGeometryCacheIDs]

4miscellaneous

4global props

4global vars

scroll0 cGlx2GeneralcScriptChecksumcExplicitVariablesfalsecHscrollScript0cLocalscHscrollHandlers0 cHtmlScript5յSHQHKI-*JrRKJҸj{ #cSelectedChunk char 36 to 35 cConstantscHandlersListWidth119 cDirtyFlagtruecHtmlHandlersZ)I). EɶJƆƖJv6 qĜļԢb}B;.;5eKkҴ4 M cFolders all handlers cHandlersdoStuffcVscrollScript0cVscrollHandlers0 cHilitedLine cGlobalscGlx2TimeStamp checksumُ B~ 1180103816start cREVGeneral breakpoints  VolumeCylinderewon mouseUp ask "Enter the radius of the cylinder:" with 1 put it into tRadius if tRadius is empty or tRadius is not a number then exit to top ask "Enter the height of the cylinder:" with 2 put it into tHeight if tHeight is empty or tHeight is not a number then exit to top put volumeCylinder(tHeight, tRadius) into tVol answer "Volume of cylinder = " & tVol end mouseUp ?L2Volume of a CylindercGlx2TimeStamp 1180102568working 1180102733end 1180102490start 1180102374working checksumqs}+\yN~' 1180102362working 1180102379start 1180102805start 1180102311start 1180102384working 1180102484start cREVGeneral revUniqueID 1180066309503  VolumeSphereew--> all handlers on mouseUp ask "Enter the radius of the sphere:" with 1 put it into tRadius if tRadius is empty or tRadius is not a number then exit to top put volumeSphere(tRadius) into tVol answer "Volume of sphere = " & tVol end mouseUp ?q2Volume of a SpherecGlx2TimeStamp 1180102568working 1186647745start 1180102490start 1180102374working checksum1VxoJ܍- 1180102815start 1180102737start 1186647870end 1186647869start 1180102379start 1180102311start 1186647792start 1180102384working 1186647724start 1180102786working 1180102756working 1180102362working 1186647852start 1180102484start cREVGeneral revUniqueID 1180066681190  VolumeConeewon mouseUp ask "Enter the radius of the cone:" with 1 put it into tRadius if tRadius is empty or tRadius is not a number then exit to top ask "Enter the height of the cone:" with 2 put it into tHeight if tHeight is empty or tHeight is not a number then exit to top put volumeCone(tHeight, tRadius) into tVol answer "Volume of cone = " & tVol end mouseUp ?UVolume of a ConecGlx2TimeStamp 1180102568working 1180102490start 1180102733end checksumqs}+\yN~' 1180102374working 1180102379start 1180102362working 1180102311start 1180102805start 1180102384working 1180102484start cREVGeneral revUniqueID 1180068495414 LibraryEw~function areaCircle pRadius -- if this function is used, all the volumes will come back as zero return 0 end areaCircle ?~RScGlx2TimeStamp 1186647891start cREVGeneral revUniqueID 1180068748801 In use`Eon mouseUp if the hilite of me then insert script of btn "Library" into front else remove script of btn "Library" from front end if end mouseUp ~F cREVGeneral revUniqueID 1180068788883  Info1  "> cREVGeneral revUniqueID 1180073709219 ;These 3 buttons call public functions in the stack script. ZThe stack script also contains a private function used by each of the 3 public functions.  Info2   4 cREVGeneral revUniqueID 1180073837873 This button will not work. @It tries to call the private function from outside it's script. Info3  ,J cREVGeneral revUniqueID 1180074162961 OUsing this library will not make any difference if using the private function. kIf you turn off 'Use private function' and have this library in use, all volumes will be returned as zero. CallPrivateew--> all handlers on mouseUp put random(10) into tRadius -- this will cause an error if areaCircle is a private function put areaCircle(tRadius) into tArea answer "The area of a circle with a radius of " & tRadius & " = " & tArea & cr & cr & \ "You must have turned off 'Use private function' or put the Library in use, or this would not have worked!" end mouseUp ?QCall a private functioncGlx2TimeStamp 1180102568working 1180102490start 1180102786working 1180102374working checksum6RJf66% 1180102815start 1180102737start 1180102756working 1180102362working 1180102379start 1180102311start 1180102384working 1180102484start 1180125337start cREVGeneral revUniqueID 1180073937938 Private`eon mouseUp if the hilite of me then set the script of this stack to the cPrivateScript of this stack else set the script of this stack to the cPublicScript of this stack end if end mouseUp QUse private function cREVGeneral revUniqueID 1180074574650  Info4   ? cREVGeneral revUniqueID 1180074918893 RThis checkbox changes the stack script to use either private or public functions. QToggle it and then test the 'Call private function' and 'Library' buttons again.Line1Kf,+ cREVGeneral revUniqueID 1180075072979Line2Kf,+ cREVGeneral revUniqueID 1180075105804Line3Kf,+ cREVGeneral revUniqueID 1180075111253