[PS][Scopes] Escaping Parent scopes

Hello fellow scripters,
What I am trying to do
once again I am committing the folly of trying to mess with scopes. Specifically, I'm trying to have a function to call the return command of the calling function (and thus end both of them). I've spent quite a few hours on this by now, crawling through the
Powershell system without much luck.
Why I want to do it
I'm trying to extend my advanced debugging system. Common users will not encounter this, it will not happen without notification, thus it will not affect the rule of don't mess with expected results. Basically I want a unified system to set exit points
in functions without having an epic stream of if (Whatever){Write-Warning "WhateverWarning"; return}.
So yes, it's not causing much of a problem, but it would enable me to write that much neater script.
What I have tried so far
I've been trying out quite a few things so far:
Test 1: Calling the nested function in the same scope as the parent function
function Get-TestA
<#
Will write:
Test1
Test2
Test2
#>
function Get-TestB
$test = "Test2"
Write-Host $test
return
$test = "Test1"
Write-Host $test
. Get-TestB
Write-Host $test
Get-TestA
This will change the $test variable in the Scope of Get-TestA as intended, but the return call does not affect the parent function (didn't expect it to, but had to verify it, just to be sure).
Test 2: Invoking the Expression
function Get-TestA
<#
Will write:
Test1
Test2
Test1
Test1
#>
function Get-TestB
$test = "Test2"
Write-Host $test
Write-Host (Get-Variable "test" -Scope 1).Value
return "return"
$test = "Test1"
Write-Host $test
. IEX (Get-TestB)
Write-Host $test
Get-TestA
Alas, it did not work either. However, playing around with variables in parent scopes as you can see. Might they prove an answer? Let's see ...
Test 3: Specifying a sessionstate
function Get-TestA
<#
Will write:
Test1
Test1
#>
[CmdletBinding()]
Param ()
function Get-TestB
[CmdletBinding()]
Param (
$State = $PSCmdlet.SessionState
$PSCmdlet.InvokeCommand.InvokeScript($State, { return }, $null)
return
$test = "Test1"
Write-Host $test
Get-TestB
Write-Host $test
Get-TestA
alas, they would not. At least not when using the parent SessionState.
I also tried calling the executioncontext (and its methods) from the parent scope, without success.
Anybody got any insights in how to realize this?
Thanks in advance,
Fred
Ps.: On break and exit.
Just in case: Yes, I have thought about using break or exit. Exit will terminate everything, which is not good from a debugging perspective.
Break is slightly less invasive, as it will - if used unchecked - break all
running commands (so if Function A calls Function B which then calls
Function C, and function C finally calls "break" it will break out of C, B
and A, even if I only want to break out of C and B).
Using named loops and break works perfectly. Example:
function TestA
<#
Writes:
I should appear A
#>
:test while ($true)
TestB
Write-Host "I should appear A"
function TestB
TestC
Write-Host "I should not appear B"
function TestC
break "test"
Write-Host "I should not appear C"
TestA
this will work perfectly. However, it would require me to wrap all interuptible functions into a named loop. This is not always easily feasible and would probably require more effort (and impact readability more) than going with the if-conditional approach.
There's no place like 127.0.0.1

Hi jrv,
another charming reply of yours :)
I'll admit to two linguistic imprecisions:
1) The terminology in the header is the correct one, not the one in the description: I do not care about the specific method of how to have function C stop function B from working, so long as it's all function C internal and does not affect function A. The
only methods (not using the programmatic term here) I knew about that allow me to escape a function (and I'm
not going to use a dedicated debugger. Those absolutely won't serve my purpose) are return, break and exit.
2) Calling return a command. I use that term generically for things that make stuff do things, including statements, functions, cmdlets, methods and kindly asking our receptionist to bring me a cup of coffee. Yeah, I should work on being more precise, at least
in the forums.
Why do you want to globally effect all?
Cause having the various debugging methods at hand in production code and environment makes it so much easier to debug an exceptional scenario in situ as it occurs. A lab environment can only catch so much after all. This would be just another tool in that
collection, but a handy one.
Oh, and before you present that assumption: I do not replace the testing phase with a presumed better debugging system. I strongly believe in the Demon Murphey, so I want to have both.
Cheers,
Fred
There's no place like 127.0.0.1

Similar Messages

  • 2008R2: OnError in parent package. Possible to 'scope' System::SourceName to parent package?

    Hi everyone,
    I have a master package that executes a few dozen child packages.
    I have an OnError handler set up at the top level of the parent package. I want to capture the name of the failed child package, is this possible? I just want to log the failed package name in a generic error message inserted into the orchestration
    table. Yes I'm aware that it'll only log one package name in the case of multiple parallel failures, i'm fine with that.
    I tried System::SourceName, but that gives me the name of the task in the child package that failed. This isn't useful for me because I use templates, so my child packages share tasks with common names.
    Thanks
    Jakub @ Adelaide, Australia

    yeah, im already doing the default dbo.sysssislog logging at the package level + custom logging into my sysssislog_extended table that captures rowcounts, delta dates and parent-child package hierarchies.
    Effort not worth the reward to look into this further, I ended up just adding 4 separate onerror handlers in the parent package on the main sequence containers. They return a hardcoded error description specifying the step (seq container) it
    stopped at
    Jakub @ Adelaide, Australia

  • Scope issue: Trying to set the value of a variable in a calling (upper) script from a called (lower) script

    Hi,
    I have a basic scope question . I have two .ksh scripts. One calls the other.
    I have a variable I define in script_one.ksh called var1.
    I set it equal to 1. so export var1=1
    I then call script_two,ksh from script_one.ksh.  In script_two.ksh I set the value of var1 to 2 . so var1=2.
    I return to script_one.ksh and echo out var1 and it still is equal to 1.
    How can I change the value of var1 in script_two.ksh to 2 and have that change reflected in script_one.ksh when I echo var1 out after returning from script_two.ksh.
    I've remember seeing this I just can't remember how to do it.
    Thanks in advance.

    Unfortunately Unix or Linux does not have a concept of dynamic system kernel or global variables.
    Environment variables can be exported from a parent to a child processes, similar to copying, but a child process cannot change the shell environment of its parent process.
    However, there are a few ways you could use: You can source execute the scripts, using the Bash source command or by typing . space filename. When source executing a script, the content of the script are run in the current shell, similar to typing the commands at the command prompt.
    Use shell functions instead of forking shell scripts.
    Store the output of a script into a variable. For instance:
    #test1.sh
    var=goodbye
    echo $var
    #test2.sh
    var=hello
    echo $var
    var=`./test1.sh`
    echo $var
    $ ./test2.sh
    hello
    goodbye

  • Why is variable scope so vexing?!  Argh!

    Dear Friends
    I used to think that if I declared a variable at the top of
    the first frame of my main timeline (and outside of any function
    bodies) that it would basically be considered "global" and could be
    accessed at any further frame in the main timeline (and by any
    child of the main timeline via prefixing enough "parent."s) but
    this is apparently not the case (unless there's something funny
    with uints where their values go to 0 from one frame to the next.)
    Is there something I'm missing here? Why is it so hard to declare a
    variable that can be easily seen throughout the main timeline (and
    the rest of the app as well)?
    And speaking of children seeing their parent's variables,
    what is the easiest way to make a variable declared on the main
    timeline accessible inside of a child? I don't want to have to
    count ancestors and add "parent.parent.parent." etc. and "root."
    doesn't seem to work... What's the magic prefix? Isn't there also a
    way of setting a variable equal to "this" on the main timeline? I
    don't know how it works, really.
    More generally speaking, does anyone have a surefire tutorial
    on variable scoping? I've read Moock and pored over the Help manual
    and it all still feels a lot less intuitive than it ought to. How
    do I master this subject?!
    Thanks and Be Well,
    Graham

    graham - you're right in saying that a var on the main
    timeline can be considered 'global' even without the use of a
    '_global' keyword - and i remember in my early learning i
    definitely thought the same thing as you are now. It's really a
    matter of 'paths' as you mention, but one does need to 'point' to
    the main in order to retrieve the value via root or a series of
    parents - even when using class structures as is more common now
    under 3, one still needs to point at the correct scope to access a
    property.
    sometimes though, a var can be 'reset' ... what i mean by
    this is, say for instance you have declared a var on the first
    frame, the playhead then navigates to a different frame wherein the
    variable has been set to a different value, then at another time
    the playhead returns to frame one (because one has a navigation
    structure that does so) in this case the variable is 're-declared'
    and set back to the default value! this type of situation often
    occurs with a timeline based system.
    class properties on the other hand, cannot be reset in this
    manner, which is one of the many reasons why class based systems
    are better for complex programming. personally, now-a-days my
    programs so not usually contain anything on the main timeline, no
    code or assets, instead all operations are achieved through code,
    mainly within class files (as is the benefit of 3)
    I'm sorry i don't know of any tuts i could point you to, just
    stick with it - i think that over time it hierarchy structure and
    path scopes become second nature - and at the rate you seem to be
    advancing, it shouldn't take long ;)

  • Variable scope with loaded external SWF's?

    I’ve got an SWF, call it calcLite, that will be deployed both independently (ie: attached to an HTML doc) and also imported at run time (linked as an external asset via the loader class) to another SWF, let’s call it calcPro. That part is working fine.
    I’ve got a global variable, gRunMode:String that calcLite must declare and set when it’s running independently, but must inherit when attached to calcPro (which will declare and set gRunMode before attaching calcLite).
    Here’s where I am:
    At the root of calcPro:
    var gRunMode:String = “touchScreen”;
    At the root of calcLite:
    var gRunMode:String = “web”
    if (this.parent == this.stage) {
         gRunMode = MovieClip(this.parent.parent.parent).gRunMode;
    I’ve also tried creating function in the parent to return gRunMode:
    At the root of calcPro:
    var gRunMode:String = “touchScreen”;
    function getRunMode():String {
         return gRunMode;
    At the root of calcLite:
    var gRunMode:String = “web”
    if (this.parent == this.stage) {
         gRunMode = MovieClip(this.parent.parent.parent). getRunMode();
    I’ve also tried the second technique, renaming the global in calcPro to gRunModeExe incase there was a naming violation. In all cases I get “attempt to access prop of a null” error. The construct MovieClip(this.parent.parent.parent).function() works, I use it later in the program for a different function and it’s fine, just doesn’t work here.

    My bad, I wrote the post from memory at home. My actual code properly tested the stage (!=) and would have worked EXCEPT under the following condition:
    This is my second project in a row that involved an SWF that must operate independently and also function as a loaded child to a bigger project. What I keep forgetting is that loaded content begins to execute IMMEDIATELY!!!, it does not wait to be attached to the stage. Further, loaded content does not have access to stage assets until it’s been attached, so any premature attempts to access global variables and functions from loaded clip to stage fail. A good explanation of these issues can be found here (scroll to middle of page, post by senocular titled Access to stage and root): http://www.kirupa.com/forum/showthread.php?p=1955201
    The solution was simple enough. If calcLite is running as a child, stop in frame 1 (before any other processing) and wait for calcPro to push us to the next frame (which happens after attachment to the stage). If calcLite is running independently skip the stop and proceed as normal.
    As for this.parent.parent.parent vs. this.parent.parent vs this.parent, since gRunMode is global within the calcPro scope any of these would probably work (although I’ve only tested the first option). The first parent references the loader object, the second parent references the movie clip to which the loader object is attached, and the third parent finally references root.

  • SCOPE Definition debuging

    Hi All,
    I am working at Prod Support Project on SSAS.
    At cube side many scope statements related to calculated members and measures are present at calculations tab.
    Could you please help us , how to check which part of the scope is applied to particular measure/calculated measure.......
    We are taking more time to find out the exact scope statement...
    Your's help is much needed here.
    Thanks & Regards,
    Mahesh Alam

    Hi Mahesh,
    According to your description, you want to know which part of the scope is applied to particular measure/calculated measure, right?
    Here is a sample SCOPE function in AdventureWork cube.
    Scope
    [Measures].[Amount],
    [Account].[Accounts].[Account Level 02].&[96], -- Headcount
    [Account].[Accounts].[Account Level 02].&[97], -- Units
    [Account].[Accounts].[Account Level 02].&[99] -- Square Footage
    Format_String ( This ) = "#,#" ;
    End Scope ;
    As you can see on function, there is a measures inside the scope function, so the scope is apply to this measures. We can use scope function inside scope function, if there is no measures specified inside the scope function, then the scope apply to the measures
    which were specified in the parent scope function.
    Reference.
    http://msdn.microsoft.com/en-us/library/ms145515.aspx
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Variable scope within an interface and some questions

    I am creating a DataStorage interface with a member variable (can I call it a member variable when it is in an interface?) called dataObject. From what I remember, and what the compiler is telling me, the scope declarations "private," or "protected" can not be used on either methods or member variables in an interface.
    Now I have another class DataInput that implements DataStorage and I want to make the dataObject private and put in accessor methods to get to the dataObject. But I also remember reading something that said, during inheritance you can not make the scope of the method (and variable?) more narrow. Meaning if a method was defined as default in the parent class, the subclass can not override that method to give it private access all of a sudden.
    Now a couple of questions with this...does that rule only apply to subclassing (that is with extends) or does it also apply to implementing interfaces. Second question, I am pretty sure that rule applies to methods that are being overriden, but does it also apply to variables in an interface...because if that is the case, I can't re-declare the variable in the class that implements the interface to be private...and then there is no way to protect that variable.
    By the way I did re-declare the variable in the subclass (implementing class) and declared it as a private, and it works...but I'm still trying to figure out the general rule.

    well if the interface variables are implicitly public static final, how come I am able to re-declare the variable name within the class that implemented the interface.
    If for example in interface Car there is a variable color, how come in class Honda implements Car, I can redeclare the variable color, and give it public access. I thought final meant final, no redeclaring...but does that not hold for static variables?

  • DHCP service randomly stopping, when restarted scopes disappear

    I have DHCP and DNS running on two OS X 10.5.7 servers; one is a G5 dual 1.8 Ghz PPC and the other is a 2.8 Ghz quad-core Intel Xserve. This summer I've added VLAN scopes (staff and student wired & wireless) with half the available addresses in each subnet on one server and the other half on the other. An odd thing has happened several times now. The DHCP service will randomly shut down and when I restart it, the new scopes have all disappeared and the old scope is back as the only choice on the list, but not enabled. When I go to check the other server I find the same thing. I thought it was just a fluke the first time it happened and just imported the DHCP settings back in from a backup. It has happened two more times since then, about once a week. If anyone can shed some light on this I'd appreciate it.

    I too am having this issue.
    DHCP service will crash (after investigation I found that it was servermgrd that crashes) all the scopes are still there, then when I restart the service it wipes out all my scopes except the default one that is in there when you initially configure the service.
    Everything goes haywire, DNS seems to go down halfway, then I put the scopes back in, and at least DHCP rights itself.
    This is a serious issue, I have 5 scopes in this server. I also have one other server that only has one scope, but does not have this issue.
    All running 10.5.6 Server on Intel Xserves.
    Here is part of my crash log:
    Process: servermgrd [41823]
    Path: /usr/sbin/servermgrd
    Identifier: servermgrd
    Version: ??? (???)
    Code Type: X86 (Native)
    Parent Process: launchd [1]
    Date/Time: 2009-08-08 13:29:02.314 -0700
    OS Version: Mac OS X Server 10.5.6 (9G71)
    Report Version: 6
    Exception Type: EXCBADACCESS (SIGSEGV)
    Exception Codes: KERNINVALIDADDRESS at 0x00000000dc45897b
    Crashed Thread: 7
    Thread 0:
    0 libSystem.B.dylib 0x937851c6 machmsgtrap + 10
    1 libSystem.B.dylib 0x9378c9bc mach_msg + 72
    2 com.apple.CoreFoundation 0x940960ae CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x94096cd8 CFRunLoopRunInMode + 88
    4 com.apple.Foundation 0x960e5d75 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 213
    5 com.apple.Foundation 0x9616434d -[NSRunLoop(NSRunLoop) runUntilDate:] + 93
    6 libservermgrcommon.dylib 0x0007b251 __XSCopyIGDDescriptor + 660
    7 libservermgrcommon.dylib 0x0007b4ca XSUpdateIGDCache + 238
    8 libservermgrcommon.dylib 0x0007b587 PortmapMaintenance + 84
    9 ...rverAdmin.servermgr_network 0x0044d814 doProcessArgs + 84
    10 libservermgrcommon.dylib 0x0007981e -[BundleManager doIdle] + 649
    11 com.apple.Foundation 0x960e5e23 __NSFireTimer + 147
    12 com.apple.CoreFoundation 0x94096b25 CFRunLoopRunSpecific + 4469
    13 com.apple.CoreFoundation 0x94096cd8 CFRunLoopRunInMode + 88
    14 com.apple.Foundation 0x960e5d75 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 213
    15 com.apple.Foundation 0x960f1e94 -[NSRunLoop(NSRunLoop) run] + 84
    16 servermgrd 0x00005937 0x1000 + 18743
    17 servermgrd 0x00002b2a 0x1000 + 6954
    Thread 1:
    0 libSystem.B.dylib 0x937d46f2 select$DARWIN_EXTSN + 10
    1 libSystem.B.dylib 0x937b6095 pthreadstart + 321
    2 libSystem.B.dylib 0x937b5f52 thread_start + 34
    Thread 2:
    0 libSystem.B.dylib 0x937851c6 machmsgtrap + 10
    1 libSystem.B.dylib 0x9378c9bc mach_msg + 72
    2 com.apple.CoreFoundation 0x940960ae CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x94096cd8 CFRunLoopRunInMode + 88
    4 com.apple.Foundation 0x96114d40 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 320
    5 com.apple.Foundation 0x960b17ed -[NSThread main] + 45
    6 com.apple.Foundation 0x960b1394 _NSThread__main_ + 308
    7 libSystem.B.dylib 0x937b6095 pthreadstart + 321
    8 libSystem.B.dylib 0x937b5f52 thread_start + 34
    Thread 3:
    0 libSystem.B.dylib 0x9378c3ae _semwaitsignal + 10
    1 libSystem.B.dylib 0x937e1e71 sleep$UNIX2003 + 63
    2 servermgrd 0x00005d4f 0x1000 + 19791
    3 com.apple.Foundation 0x960b17ed -[NSThread main] + 45
    4 com.apple.Foundation 0x960b1394 _NSThread__main_ + 308
    5 libSystem.B.dylib 0x937b6095 pthreadstart + 321
    6 libSystem.B.dylib 0x937b5f52 thread_start + 34
    Thread 4:
    0 libSystem.B.dylib 0x93785226 semaphoretimedwait_signaltrap + 10
    1 libSystem.B.dylib 0x937b71ef pthread_condwait + 1244
    2 libSystem.B.dylib 0x937b8a73 pthreadcond_timedwait_relativenp + 47
    3 com.apple.Foundation 0x960f775c -[NSCondition waitUntilDate:] + 236
    4 com.apple.Foundation 0x960f7570 -[NSConditionLock lockWhenCondition:beforeDate:] + 144
    5 libservermgrcommon.dylib 0x00078953 -[BundleManager doBatchCommand:forUser:] + 715
    6 servermgrd 0x00007b42 0x1000 + 27458
    7 servermgrd 0x00006ebd 0x1000 + 24253
    8 servermgrd 0x00006213 0x1000 + 21011
    9 com.apple.Foundation 0x960b17ed -[NSThread main] + 45
    10 com.apple.Foundation 0x960b1394 _NSThread__main_ + 308
    11 libSystem.B.dylib 0x937b6095 pthreadstart + 321
    12 libSystem.B.dylib 0x937b5f52 thread_start + 34
    Thread 5:
    0 com.apple.CoreFoundation 0x94099009 CFEqual + 25
    1 com.apple.CoreFoundation 0x9409aa65 __CFSetFindBuckets2 + 293
    2 com.apple.CoreFoundation 0x9409be18 CFSetAddValue + 360
    3 com.apple.CoreFoundation 0x94089e71 _uniqueStringForCharacters + 417
    4 com.apple.CoreFoundation 0x9408a289 getString + 825
    5 com.apple.CoreFoundation 0x9408e4bb parseXMLElement + 5515
    6 com.apple.CoreFoundation 0x9408f653 parseDictTag + 147
    7 com.apple.CoreFoundation 0x9408dcb5 parseXMLElement + 3461
    8 com.apple.CoreFoundation 0x9408d8f0 parseXMLElement + 2496
    9 com.apple.CoreFoundation 0x9408eea2 _CFPropertyListCreateFromXMLData + 2402
    10 com.apple.Foundation 0x96102fb2 +[NSPropertyListSerialization propertyListFromData:mutabilityOption:format:errorDescription:] + 66
    11 com.apple.servermgr_dhcp 0x0024563f -[DHCPRequestHandler writeConfigurationFile] + 320
    12 com.apple.servermgr_dhcp 0x002454f4 -[DHCPRequestHandler readConfigurationFile] + 3447
    13 com.apple.servermgr_dhcp 0x00241f7c -[DHCPRequestHandler getStateWithRequest:] + 244
    14 libservermgrcommon.dylib 0x00077414 -[PluginRequestHandler doProcessInputWithRequest:context:lockFileFD:] + 315
    15 libservermgrcommon.dylib 0x000791c0 -[BundleManager doCommand:withModule:forUser:] + 905
    16 libservermgrcommon.dylib 0x00078ba7 -[BundleManager doOneBatchCommand:] + 448
    17 com.apple.Foundation 0x960b17ed -[NSThread main] + 45
    18 com.apple.Foundation 0x960b1394 _NSThread__main_ + 308
    19 libSystem.B.dylib 0x937b6095 pthreadstart + 321
    20 libSystem.B.dylib 0x937b5f52 thread_start + 34
    Thread 6:
    0 com.apple.CoreFoundation 0x940c6e3e __CFStrConvertBytesToUnicode + 62
    1 com.apple.CoreFoundation 0x940b7397 CFStringFindCharacterFromSet + 743
    2 com.apple.Foundation 0x960f249c -[NSString rangeOfCharacterFromSet:options:range:] + 108
    3 com.apple.Foundation 0x96135ae9 -[NSScanner scanCharactersFromSet:intoString:] + 297
    4 ...e.ServerAdmin.servermgr_web 0x01dddb40 doProcessArgs + 4517
    5 ...e.ServerAdmin.servermgr_web 0x01dddda4 doProcessArgs + 5129
    6 ...e.ServerAdmin.servermgr_web 0x01dfaccf doProcessArgs + 123700
    7 libservermgrcommon.dylib 0x000582e0 -[ConfigurationParser initWithFile:typesFile:defaultsFile:populateDefaults:] + 174
    8 ...e.ServerAdmin.servermgr_web 0x01dfa0b5 doProcessArgs + 120602
    9 ...e.ServerAdmin.servermgr_web 0x01dfdab7 doProcessArgs + 135452
    10 ...e.ServerAdmin.servermgr_web 0x01dfd8c1 doProcessArgs + 134950
    11 ...e.ServerAdmin.servermgr_web 0x01dd2edc getservicestate + 322
    12 ...e.ServerAdmin.servermgr_web 0x01ddb81b doProcessInput + 560
    13 ...e.ServerAdmin.servermgr_web 0x01ddccaa doProcessArgs + 783
    14 libservermgrcommon.dylib 0x000791c0 -[BundleManager doCommand:withModule:forUser:] + 905
    15 libservermgrcommon.dylib 0x00078ba7 -[BundleManager doOneBatchCommand:] + 448
    16 com.apple.Foundation 0x960b17ed -[NSThread main] + 45
    17 com.apple.Foundation 0x960b1394 _NSThread__main_ + 308
    18 libSystem.B.dylib 0x937b6095 pthreadstart + 321
    19 libSystem.B.dylib 0x937b5f52 thread_start + 34
    Thread 7 Crashed:
    0 libobjc.A.dylib 0x9512f688 objc_msgSend + 24
    1 ....ServerAdmin.servermgr_info 0x0038465e 0x37d000 + 30302
    2 ....ServerAdmin.servermgr_info 0x0037e431 0x37d000 + 5169
    3 libservermgrcommon.dylib 0x000791c0 -[BundleManager doCommand:withModule:forUser:] + 905
    4 libservermgrcommon.dylib 0x00078ba7 -[BundleManager doOneBatchCommand:] + 448
    5 com.apple.Foundation 0x960b17ed -[NSThread main] + 45
    6 com.apple.Foundation 0x960b1394 _NSThread__main_ + 308
    7 libSystem.B.dylib 0x937b6095 pthreadstart + 321
    8 libSystem.B.dylib 0x937b5f52 thread_start + 34
    Thread 7 crashed with X86 Thread State (32-bit):
    eax: 0x9511e861 ebx: 0x00380c61 ecx: 0x951aaa64 edx: 0xdc45895b
    edi: 0x00000000 esi: 0xa016e180 ebp: 0xb06dc958 esp: 0xb06dc7f8
    ss: 0x0000001f efl: 0x00010282 eip: 0x9512f688 cs: 0x00000017
    ds: 0x0000001f es: 0x0000001f fs: 0x0000001f gs: 0x00000037
    cr2: 0xdc45897b
    Binary Images:
    0x1000 - 0x10ff7 +servermgrd ??? (???) <6d1e5419c0bf1ad43ef3c5189228f0ad> /usr/sbin/servermgrd
    0x51000 - 0x84ff7 libservermgrcommon.dylib ??? (???) <ee8fb2c333b268482f4fc7b7b79634fc> /usr/lib/libservermgrcommon.dylib
    0xa2000 - 0xc5ff7 com.apple.frameworks.server.core 1.0 (1.0) <352102e4e062c441fd0be0d6d4bc7305> /System/Library/PrivateFrameworks/CoreServer.framework/Versions/A/CoreServer
    0xd3000 - 0xe5ffd com.apple.servermgr_accounts 10.5.3 (10.5.3) /usr/share/servermgrd/bundles/servermgraccounts.bundle/Contents/MacOS/servermgraccounts
    0xef000 - 0xf6fff com.apple.ServerAdmin.servermgr_afp 10.5 (2.0) <a27c4a92067e344cedd93dd2ff7b6231> /usr/share/servermgrd/bundles/servermgrafp.bundle/Contents/MacOS/servermgrafp
    0x200000 - 0x20ffff com.apple.frameworks.server.foundation 1.0.2 (1.0.2) <0acc9dd1e8a8e9f694a431b609bc2225> /System/Library/PrivateFrameworks/ServerFoundation.framework/Versions/A/ServerF oundation
    0x22a000 - 0x22fffd com.apple.servermgr_backup 10.5 (10.5) /usr/share/servermgrd/bundles/servermgrbackup.bundle/Contents/MacOS/servermgrbackup
    0x236000 - 0x23afff com.apple.ServerAdmin.servermgr_calendar 10.5 (10.5) <389fb095464da73d3023f9136ce3be04> /usr/share/servermgrd/bundles/servermgrcalendar.bundle/Contents/MacOS/servermgrcalendar
    0x241000 - 0x24affc com.apple.servermgr_dhcp 10.5.3 (10.5.3) <268b1327d65be8ef780416f8396f3f1c> /usr/share/servermgrd/bundles/servermgrdhcp.bundle/Contents/MacOS/servermgrdhcp

  • Access Scope Warning When Adjusting Mandatory Override Settings?

    Hi all,
    In my opinion, the access scope warning dialog should not appear when the user modifies mandatory override settings.
    Under "Class Properties" for a .lvclass
    Under "Item Settings"
    When modifying the settings of a dynamic dispatch VI
    If the user modifies one of the two checkboxes pertaining to mandatory override...
    Regardless of whether the access scope actually changes, a warning dialog appears, and selecting "Yes" seems to cause the IDE to mark unsaved changes for other classes in the class hierarchy chain.  The warning dialog should not appear when all the user does is set the state of the two checkboxes, and to me it doesn't make sense that all of the other classes now have to be saved.  (I claim some ignorance on the saving part, though -  it's just my intuition.)
    Does this make sense?
    Thanks,
    Mr. Jim

    This was consciously discussed when the dialog was added. We decided that it should appear. You may choose "no", but the option should be there. By setting the must override setting all the way down the tree, we felt we and our users would be less likely to introduce mistakes when refactoring to add or remove parent classes. There were times when this seemed like a good idea and so worth offering the option to automatically do it.

  • Performance problems with use SCOPE instruction?

    Hi All!
    We have application work with cube bases on SSAS 2008 R2. Also we use writeback function for change data in cube.
    Now I'm looking bottleneck in our queries.
    We have following MDX query(for example):
    select
    non empty{
    ([Date].[Date].[All].children
    , [Forecast Type].[Forecast Type].[All].children
    , [Stock].[Stock].[All].children
    , [Shipment].[Shipment].[All].children
    , [Invoice].[Invoice].[All].children
    , [Way Bill External].[Way Bill External].[All].children
    , [SD User].[User].[All].children
    , [SD Date].[Date].[All].children
    , [CD User].[User].[All].children
    , [CD Date].[Date].[All].children
    , [Forecast Basis].[Forecast Basis].[All].children
    , [Orders].[Orders].[All].children
    , [Rolling Forecast].[Rolling Forecast].[All].children
    , [Long Range Forecast].[Long Range].[All].children
    , [Calculated FCCR].[Calc Price].[All].children
    , [Write Table Guids].[GuidObj].[All].children)
    } dimension properties member_unique_name
    , member_type
    , member_value on rows
    , non empty {({[Measures].[Price CR]
    , [Measures].[Cost]
    , [Measures].[Cost USD]
    , [Measures].[Cost LME]
    , [Measures].[Cost MWP]
    , [Measures].[Weight]
    , [Measures].[Weight Real]})} dimension properties member_unique_name
    , member_type
    , member_value on columns
    from [MainCubeFCT]
    where ({[Currency].[Currency].&[4]}
    , {[Forecast Basis].[Customer].&[4496]}
    , {[Forecast Basis].[Consignee].&[4496]}
    , {[Forecast Condition].[Forecast Condition].&[1]}
    , {[Forecast Basis].[Alloy].&[56]}
    , {[Date].[Year Month].[Month].&[2015-05-01T00:00:00]}
    , {[Date Type].[Date Type].&[2]}
    , {[Forecast Basis].[Business Sphere2].&[4]}
    , {[Forecast Status].[Forecast Status].&[2]})
    Duration execution this query(Query end):
    cold(after clear cache) - 1000
    warm - 500
    Max loss on Calculate Non empty event - 95%.
    After some operations I found bottleneck in 2 measures: [Measures].[Weight], [Measures].[Price CR]
    If them deleted from query then duration execution equals 50.
    In our cube measure [Measures].[Weight] override in calculation as: 
    scope([Measures].[Weight]);
    This = iif((round([Measures].[Weight], 3)<>0), round([Measures].[Weight], 3), null);
    end scope;
    But if I change code as 
    scope([Measures].[Weight]);
    This = [Measures].[Weight];
    end scope;
    Performance query does not improve...
    If delete this override from calculation in cube. I get good performance acceptable to me.
    We need to keep the business logic and get acceptable performance.
    What wrong in measures, calculations or query? Any ideas?
    If need additional information let me know.
    Many thanks, Dmitry.

    Hi Makarov,
    According to your description, you get performance issue when using SCOPE() statement. Right?
    In Analysis Services, when using SCOPE() statement, it redefines that part of your cube space while the calculated member is much more isolated. In this scenario, I suggest you directly create a measure. Because calculated measure only returns values
    where the amounts are recorded directly to the parent without including children values.
    Reference:
    Analysis Services Query Performance Top 10 Best Practices
    Top 3 Simplest Ways To Improve Your MDX Query
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Configuring the PR Scope of List

    Dear Gurus
    I am trying to configure the PR scope of List.
    Our requirement is that the PR list displayed in ME57 should be able to show the PR item text.
    Believe new routines would have to be defined to be able to select in customizing.
    How can this be done? where can we define the routines to be able to select while customizing the scope of list for PR?
    SPRou2014Purchasingu2014Reportingu2014Maintain PRu2014Scope of List
    Regards
    Ravi

    Hello Ravi, hope you're well (escaped yet ??)
    That's one for the ABAPers !
    Cheers,
    Nick

  • Variable scope issue - EWS

    Hi everyone,
    So I have a funny issue. From line 8 to line 37 I declare a set of variables, most of them with null values. Then I call a function: SetupEWSAndFolder (line 88) which sets a lot of these variables. Once the function exits, the variables are empty.
    How come ? I thought that variables defined at script level would be updated in child functions ? Is it because of the null value ? I have another script with the same kind of setup but the variables are not set to null and it works perfectly fine.
    And for the fun, i tested echoing the value at the end of the function of some variables and then outside and the one outside are not updated
    I also tested using: $global:mb for instance, I still have the initial value set in the script and not the one updated in the function
    Thanks for helping me clear up my misunderstanding of the issue
    Olivier
    # Using Export - Import would be easier but since we do not have the rights for it and it requires a specific role being assigned to us... here goes EWS!!!
    # Include the Exchange Web Service DLL
    Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll"
    # Import the logwrite ability
    . .\LogWrite.ps1
    ################################################### INITIAL VARIABLES SETUP ###################################################
    #Setting up the log file
    #$userLogon = $args[0]
    $userLogon = "olivraga"
    $Logfile = "$userLogon.log"
    #setting up the name of the top folder in which to transfer #Inbox#, #SentItems#, #DeletedItems#
    $folderName = "_AutoOffBoardingArchiveFolder"
    #get the current username
    $credUserName = Get-Content env:username
    #Setting the mailbox variable for the folder binds in EWS
    $mailbox = $null
    #Setting up the Exchange Web Services connection
    $ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP2
    $service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService($ExchangeVersion)
    $mb = $null
    #Setting up the folder variables for general calls
    $rootFolderID = $null
    $topFolder = $null
    $iFolder = $null
    $dFolder = $null
    $sFolder = $null
    #Setting up the folder ID to the targetted mailbox
    #(otherwise we would target the mailbox of the current account which we do not want :))
    $inboxID = $null
    $deletedItemsID = $null
    $sentItemsID = $null
    #Setting up the #Inbox# , #SentItems# , #DeletedItems# folder variables
    $inbox = $null
    $deletedItems = $null
    $sentItems = $null
    ############################ Function that moves a folder to another folder, including sub folders ############################
    function MoveItems(){
    $source, $dest, $path = $args[0]
    LogWrite "Copying/Moving $path"
    #Pulls items by thousands at a time
    $ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1000)
    $fiItems = $null
    do{
    #Get the 1000 items present in the source folder
    $fiItems = $service.FindItems($source.Id,$ivItemView)
    foreach($Item in $fiItems.Items){
    # Copy the Message
    $Item.Copy($dest.Id) | out-null
    # If you want to switch to a move instead use:
    #$Item.Move($dest.Id)
    $ivItemView.Offset += $fiItems.Items.Count
    }while($fiItems.MoreAvailable -eq $true)
    #Do the subfolders now
    if ($source.ChildFolderCount -gt 0)
    # Deal with any subfolders first
    $folderView = New-Object Microsoft.Exchange.WebServices.Data.FolderView(1000)
    $foldersFound = $source.FindFolders($folderView)
    ForEach ($subFolder in $foldersFound.Folders)
    $subFolderToCreate = New-Object Microsoft.Exchange.WebServices.Data.Folder($service)
    $subFolderToCreate.DisplayName = $subFolder.DisplayName
    $subFolderToCreate.Save($dest.Id)
    MoveItems($subFolder, $subFolderToCreate, $path+"\"+$subFolder.DisplayName)
    ################################# Initial necessary setup like full access and EWS connection #################################
    function SetupEWSAndFolder(){
    $mailbox = (Get-ADUser $userLogon -Properties mail).mail
    # Giving the current account Full Access to the Mailbox
    Add-MailboxPermission -Identity $mailbox -User $credUserName -AccessRights FullAccess -InheritanceType All -Confirm:$false
    $service.Url = "https://webmail.brookfieldrenewable.com/EWS/Exchange.asmx"
    #$service.Credentials = new-object Microsoft.Exchange.WebServices.Data.WebCredentials($userLogon,$userPassword,"hydro")
    #$service.Credentials = $creds.GetNetworkCredential()
    $service.UseDefaultCredentials = $true
    $service.AutodiscoverUrl($mailbox)
    $mb = new-object Microsoft.Exchange.WebServices.Data.Mailbox("$mailbox")
    #Get the root folder ID of the targetted mailbox
    $rootFolderID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::msgfolderroot, $mb)
    #Create new top folder to contain the Inbox, DeletedItems and SentItems folder
    $topFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $topFolder.DisplayName = "$folderName"
    $topFolder.Save($rootFolderID)
    #Create the subfolders to the topFolder to copy or move the emails in #Inbox# , #SentItems# , #DeletedItems#
    $iFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $iFolder.DisplayName = "Inbox"
    $iFolder.Save($topFolder.Id)
    $sFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $sFolder.DisplayName = "SentItems"
    $sFolder.Save($topFolder.Id)
    $dFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $dFolder.DisplayName = "DeletedItems"
    $dFolder.Save($topFolder.Id)
    #Just to make sure that the folder is created and everything is updated nicely
    Start-Sleep 5
    $inboxID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$mb)
    $deletedItemsID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::DeletedItems,$mb)
    $sentItemsID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::SentItems,$mb)
    $inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service, $inboxID )
    $deletedItems = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service, $deletedItemsID)
    $sentItems = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service, $sentItemsID)
    SetupEWSAndFolder #setup the EWS connections and the folders
    MoveItems ($inbox, $iFolder, "Inbox") #Copy (not move yet) Inbox to the archive folder
    MoveItems ($deletedItems, $dFolder, "DeletedItems") #Same but for deleted items
    MoveItems ($sentItems, $sFolder, "SentItems") #Same but for sent items
    ##################################################### Helper Code Blocks ######################################################
    <#
    #Block of code in case one does not know the ID of the folder, but since we just created the topFolder, we do not need to search for it :)
    #Bind to the MSGFolder Root
    $rootFolderId = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::MsgFolderRoot,"hydro\$userLogon")
    #Setup the retrieval of the folder ID just created
    $targetFolder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$rootFolderId)
    $searchFilter = new-object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo([Microsoft.Exchange.WebServices.Data.FolderSchema]::DisplayName,$folderName)
    $folderView = new-object Microsoft.Exchange.WebServices.Data.FolderView(1)
    $findFolderResults = $service.FindFolders($rootFolderId, $searchFilter, $folderView)
    #>

    When you read the about_scope you see:
            - An item you include in a scope is visible in the scope in which it
              was created and in any child scope, unless you explicitly make it
              private. You can place variables, aliases, functions, or Windows
              PowerShell drives in one or more scopes.
    To me, it means that if you define a variable at the script level, it is going to be availble at the function level. To me, the function scope level is a child of the script scope level.
    So I did a check and it works like you say. But it is annoying, look at the following script and result:
    #This is a scope test:
    $nbErrors = "script";
    Function DoErrorTest(){
    $nbErrors
    $nbErrors = "inside"
    $nbErrors
    DoErrorTest
    $nbErrors
    Result:
    script
    inside
    script
    Which logical and totally annoying at the same time. And, to me, it means that you can never assign a value in a child scope by using the name of the variable. But you can display the value of the parent scope variable as long as you don't give a value to
    a same name variable in a child scope....
    This is gonna be annoying...
    Thanks

  • Scope issue?

    Folks, I have a question on scope (or at least I think it is a scope question.
    Here is what I want to do. In my game class (that manages the turns and picks a winner), I want to create either a SmartPlayer or a DumbPlayer object. Both are children of Player. My first run at this ended with a scope issue which, through your suggestions, I solved. I made some changes to the code and got past it.
    (code below) I created an Interface PlayerInt which has the required methods (I know in this simple program, I don't need an Interface, but I am trying to learn about them and inheritance, and other things. ).Then I defined a Player class, and SmartPlayer and DumbPlayer. Player has the private name variable and a setter to set the name properly. In the constructor for SmartPlayer and DumbPlayer, I call setName("the name").
    When I run the game, I declare Player computer and then instantiate a either a SmartPlayer or DumbPlayer object and assign it to Player. Howver, computer.name is null. I don't understand why it is not being set.
            Player computer = null;
            if (generator.nextInt(2) == 0){
                  computer = new SmartPlayer();
            } else {
                 computer = new DumbPlayer();
            } Thanks, in advance. Oil.
    relevant code below:
    public interface PlayerInt {
        public int takeTurn (int stones);
        public void setName(String theName);
        public String getName ();
    public class Player implements PlayerInt {
        public String getName () {
            return name;
        public void setName (String theName) {
            name = theName;
         public int takeTurn(int stones){
             return -1;
        private String name;
    public class DumbPlayer extends Player {
        public void DumbPlayer () {
            setName("Dumb Player");
    * Take a random number of stones that are less than or equal to 1/2 pile.
    * PlayerInt must take between 1 and 1/2 stones. At 3 or less, can only take 1 stone and comply with rules.
    * @param stones this is the number of stones in the pile.
    * @return returns the number of stones taken.
        public int takeTurn (int stones) {
            Random generator = new Random();
            int stonesTaken = 0;
            if (stones > 3) {
                stonesTaken = generator.nextInt((1 + stones)/2);
            } else {
                stonesTaken = 1;
            return stonesTaken;
    public class SmartPlayer extends Player {
        public void SmartPlayer() {
            setName("Smart Player");
         * PlayerInt takes a turn based on rules.
         * PlayerInt takes enough stones to make the pile 1 power of 2 less than 3, 3, 7, 15, 31, or 63 and less than 1/2 the pile.
         * If the pile is already 3, 7, 15, 31, or 63, take a random stone.
         * @param stones the number of stones left in the pile.
         * @return the number of stones taken.
        public int takeTurn (int stones) {
            int halfstones = stones/2;
            int stonesToTake = 0;
            switch (stones) {
                case 1:
                case 2:
                case 3:
                    stonesToTake = 1;
                    break;
                case 7:
                case 15:
                case 31:
                case 63:
                    Random generator = new Random();
                    stonesToTake = generator.nextInt(1 + halfstones);
                    break;
                default:
                    if (stones > 3 && stones < 7){
                        stonesToTake = stones - 3;
                    } else if (stones > 7 && stones < 15) {
                        stonesToTake = stones - 7;
                    } else if (stones > 15 && stones < 31) {
                        stonesToTake = stones - 15;
                    } else if (stones > 31 && stones < 63) {
                        stonesToTake = stones - 31;
                    }else if (stones > 63) {
                        stonesToTake = stones - 63;
            return stonesToTake;
    public class Game {
        // Let player choose to play smart vs dumb, human vs computer,
        //human vs dumb, or human vs smart.
        public void playGame() {
            Pile thePile = new Pile();
            Random generator = new Random();
            int turn = generator.nextInt(2);
            HumanPlayer human = new HumanPlayer();
            boolean foundWinner = false;
            String winner = "";
            int stonesTaken;
    // declare parent
            Player computer;
    // instantiate and assign a SmartPlayer or DumbPlayer object to Player reference.
            if (generator.nextInt(2) == 0){
                  computer = new SmartPlayer();
            } else {
                 computer = new DumbPlayer();
            if (turn == 0) {
    // Should print out either "Smart Player" or "Dumb Player"
                System.out.println(computer.getName() + " took the first turn. There are " + thePile.getNumberOfStones() + " stones in the pile.");
            } else {
                System.out.println("You take the first turn. There are " + thePile.getNumberOfStones() + " stones in the pile.");
            while (!foundWinner) {
                if (turn == 0) {
                    stonesTaken = computer.takeTurn(thePile.getNumberOfStones());
                    thePile.takeStones(stonesTaken);
                    System.out.println(computer.getName() + " took: " + stonesTaken + " stones.");
                    turn = 1;
                } else {
                    thePile.takeStones(human.takeTurn(thePile.getNumberOfStones()));
                    turn = 0;
                if (thePile.getNumberOfStones() == 0) {
                    if (turn == 0) {
                        foundWinner = true;
                        winner = human.getName();
                    } else {
                        foundWinner = true;
                        winner = computer.getName();
            }// end while
            System.out.println("The winner is " + winner + ".");
    }

    To be honest. I'd keep both interface and abstract class.
    But instead of using a reference to the abstract class use the interface instead.
    So
    PlayerInt player = null;
    //later
    player = new DumbPlayer();This is actually the "correct" way of doing this. So basically any code that uses the PlayerInt does not actually need to know what implementation is being used. In your example this is not important since you initialize it yourself but imagine you had an APIthat exposed the computer player with a method like this...
    public PlayerInt getComputerPlayer()Then other code can use this method to get a PlayerInt implementation. It won't know which one, and it won't care. And that's why this is flexible and good. Because you can add new implementations later.
    The Player abstract class is actually hidden away from most code as an implementation detail. It's not great to use abstract classes as reference types because if you want to create new implementations later among other things you've boxed yourself in to a class heirarchy. But abstract classes are good for refactoring away boilerplate code, as you have already done here. There's no point in implementing get/setName over and over again so do as you have here, create an abstract class and stick the basic implementation there.
    Anyway all this is akin to why it is preferrable (uj slings and arrows aside) to do things like
    List<String> list = new ArrayList<String>();All you care is that you have a List (interface), you don't care what implementation (ArrayList) nor do you care that there is an abstract class (or two) that ArrayList extends.

  • [Scopes] Execute command in specific scope

    Hello fellow Powershell users,
    I am currently looking for a way to execute a command in a specific scope of my choice. While some commands offer a choice in how they do that, many do not. Any ideas on how to do this?
    Background:
    I occasionally find it useful or necessary to affect items on another scope. With Variables that's not an issue, but with items like Aliases or Functions that's not quite as simple, since the standard provider cmdlets only appear to work within the current
    scope (And that allscope option on Aliases is a joke - you can remove-item them all day long without affecting them in a parent scope, which es exactly what the documentation suggests should work).
    That situation got me thinking, and knowing generally on how to do this would be great.
    Cheers,
    Fred
    There's no place like 127.0.0.1

    Hi Matt,
    sure I can:
    Remove-Item Alias:\ri
    This will delete the Alias from the current scope, but not globally. I know of no way to specify scope on PSDrive stored variables and functions / commands will by default affect content in the current scope (yeah, I was a bit inprecise in my
    terminology there).
    The concrete mater at hand is that I'm busy writing a module that creates extended Aliases (Predefined parameters, added aliases for parameters, constrained Validate-Sets ... stuff like that). So I'm trying to implement a Force parameter that will replace
    current aliases with the "new one" (I actually compile it as a function and real Aliases take precedence over functions ... and any changes I make to the aliases revert once the command ends and the user returns to the parent scope).
    Anyway, since I don't want to be fighting that same battle the next time I have trouble with scopes, I got wondering whether there's a way to choose on the function side which scope it affects, instead of finding an individual way each time a problem occurs...
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • Sharing application scope

    This question has been asked in the past but not answered completely, so here is my issue:
    I am currently working on a site that has two separate sections(one public section and another admin section), but need to share the same Application variables.
    Basic file structure....
    Root
    -- Admin  -- Application.cfc  -- index.cfm 
    -- Application.cfc  -- index.cfm  
    The public side will contain the application start and end code and the the admin Application.cfc will include the public application.cfc(<cfinclude template="../Application.cfc" />) and the login logic.   The reason I am trying to do this is that my application scope needs to be accessible by both sides. My understanding is that the CF server will treat this all as one application since they have the same name.
    During my testing, I set application.cfcroot variable in the public application.cfc.  That variable is not accessible in the admin subfolder.  My understanding is the fact that by including the original(public) application.cfc, the application.cfcroot variable will be accessible in subfolders(in this case: admin).  Th error I get is that the variable is undefined.  I test this by trying to dump the application right after I include it in my application.cfc located in the admin folder.  For example:
    Contents of application.cfc in root:
    <cfset this.name="myapp" >
    <cffunction name = "onApplicationStart">
         <cfset application.cfcroot = "myapp.cfcs.">
    </cffunction>
    Contents of application.cfc in admin folder:
    <cfinclude template="../Application.cfc" />
    <cfdump var="#application#" label="1" />
    error:
    Variable APPLICATION is undefined.
    Any ideas?

    Session management is enabled as the rest of my app relies on sessions.  Also, application variables are enabled in the administrator.  I had no idea it was in there, but it is checked.  Here are my Application.cfc files:
    Application.cfc (root/gemstartech directory)
    <cfcomponent>
              <cfset this.name="gemstartech" >
              <cfset this.sessionmanagement=true >
              <cfset this.setclientcookies=true >
              <cfset this.setdomaincookies=false >
              <!---This sets timeout to be 20 minutes(days, hours, minutes, seconds)--->
              <cfset this.sessiontimeout="#CreateTimeSpan(0,0,20,0)#" >
              <cffunction name = "onApplicationStart">
            <cfset application.cfcroot = "gemstartech.cfcs.">
              </cffunction>
              <cffunction name = "onRequestStart">
                        <cfparam name="CGI.REMOTE_ADDR" default="">
                        <cfinclude template="shared/udf.cfm">
              </cffunction>
    </cfcomponent>
    Application.cfc (root/gemstartech/admin directory)
    <cfcomponent extends="gemstartech.Application">
    <cfset this.applicationTimeout = "#createTimespan(1,0,0,0)#">
    <cfset this.sessionManagement = "true">
    <cfset this.sessionTimeout = "#createTimeSpan(0,0,20,0)#">
    <cffunction name = "onApplicationStart">
         <!--- The keyword super stands for the parent Application component. Calling its onApplicationStart method will initialize the variable application.cfcroot --->
         <cfset super.onApplicationStart()>
         <cfset application.testAdminVar= "aValue">
    </cffunction>
    <cfdump var="#application#" label="1" />
    <!--- log user out if they click 'logout' --->
    <cfif isDefined("url.logout") >
              <cfset structClear(session)>
              <cflogout>
              <cflocation url="index.cfm" addtoken="no">
    </cfif>
    </cfcomponent>

Maybe you are looking for