REVO2700 Private 2 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. f c, 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. cGalaxyStartupFile X/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 U arial W arial $ W arial U Lucida Grande U Lucida Grande W Lucida Grande U Lucida Grande U Arial U Arial W Arial U Verdana cREVGeometryCache stackID 1048 cGlx2TimeStamp 01180103028 working checksum Y_!Qk;k1180103185 working1180103906 start1180102376 start1180103188 working1186647869 end1180103602 working1180102944 start1180102154 working1180102235 working1180103991 end1180103598 start1180102870 working1186647732 start1180102873 working1186647822 start1180103537 start1180102962 start1180102730 working1180104035 start1180125320 start1180102733 start1180102175 working1180102489 start1186647984 start1180102181 working1180103386 start1180102031 start1180103551 working1180102580 start1180103393 working1180102899 working1180102829 start1180103325 start1180102202 working1180125262 start1180103563 start1186647851 end1180103174 start1180103570 start1180102842 working1180103024 working1180103735 working1180103573 working1180102926 start1186647859 start1180102998 working cREVGeneral debugObjects breakpoints stackfileversion Card1 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 , cTopLeft 522,314 cREVGeometryCacheIDs 1180074574650 10441180075072979 10461180068788883 10301180066309503 10201180073937938 10381180068748801 10281180074162961 10391180066681190 10211180073837873 10371180073709219 10361180075105804 10471180068495414 10261180074918893 10451180075111253 1048 cREVGeometrycache total 14order cGlxGeneral object name Card1 parent stack Privateimmed stack PrivatehilitedLine 7props
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
scroll 0 cGlx2General cScriptChecksum cExplicitVariables falsecHscrollScript 0cLocals cHscrollHandlers 0cHtmlScript 5 յSHQHKI-*JrRKJҸ j{ # cSelectedChunk char 36 to 35cConstants cHandlersListWidth 119cDirtyFlag truecHtmlHandlers Z )I). EɶJƆƖJv6 qĜļԢb}B;.;5eKkҴ4 M cFolders all handlers cHandlers doStuffcVscrollScript 0cVscrollHandlers 0 cHilitedLine cGlobals cGlx2TimeStamp checksum ُ B~1180103816 start cREVGeneral breakpoints VolumeCylinder ewon 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 ? L 2 Volume of a Cylinder cGlx2TimeStamp 1180102568 working1180102733 end1180102490 start1180102374 working checksum qs}+\yN~'1180102362 working1180102379 start1180102805 start1180102311 start1180102384 working1180102484 start cREVGeneral revUniqueID 1180066309503 VolumeSphere ew--> 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 ? q 2 Volume of a Sphere cGlx2TimeStamp 1180102568 working1186647745 start1180102490 start1180102374 working checksum 1VxoJ܍-1180102815 start1180102737 start1186647870 end1186647869 start1180102379 start1180102311 start1186647792 start1180102384 working1186647724 start1180102786 working1180102756 working1180102362 working1186647852 start1180102484 start cREVGeneral revUniqueID 1180066681190 VolumeCone ewon 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 ? U Volume of a Cone cGlx2TimeStamp 1180102568 working1180102490 start1180102733 end checksum qs}+\yN~'1180102374 working1180102379 start1180102362 working1180102311 start1180102805 start1180102384 working1180102484 start cREVGeneral revUniqueID 1180068495414 Library Ew ~function areaCircle pRadius -- if this function is used, all the volumes will come back as zero return 0 end areaCircle ?~ R S cGlx2TimeStamp 1186647891 start cREVGeneral revUniqueID 1180068748801 In use `E on 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. CallPrivate ew--> 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 ? Q Call a private function cGlx2TimeStamp 1180102568 working1180102490 start1180102786 working1180102374 working checksum 6RJf66%1180102815 start1180102737 start1180102756 working1180102362 working1180102379 start1180102311 start1180102384 working1180102484 start1180125337 start cREVGeneral revUniqueID 1180073937938 Private `e on 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 Q Use 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. Line1 Kf , + cREVGeneral revUniqueID 1180075072979 Line2 Kf , + cREVGeneral revUniqueID 1180075105804 Line3 Kf , + cREVGeneral revUniqueID 1180075111253