Skip to main content

Questions tagged [scope]

Scope is an enclosing context where values and expressions are associated. Use this tag for questions about different types of scope as well for questions where scope may be unclear.

1 vote
1 answer
20 views

in gnucobol, sub programs of one parent can't invoke each other

I'm currently trying to achieve a pattern to write modest these days' programs in cobol. By these days' programs I mean a source file with a few variables and procedures visible to each other. The ...
alex's user avatar
  • 859
1 vote
1 answer
48 views

Scopes and middleware

When registering services, one can optionally wrap these in additional middleware. However, the only way I found to do so in separate and then aggregate was using the .scope function. I particularly ...
João Conde's user avatar
0 votes
0 answers
12 views

Node.js - Making an eventEmitter object be common across different scopes

I am new to node.js and javascript but not coding. This is more of a syntax question of "why does this work?" so I can understand the nuances involved I defined an emitter object in my main....
Jeff Orwick's user avatar
0 votes
0 answers
17 views

Difference in Output Between Two Similar C++ Codes with Nested Loops and transform

I'm experiencing a strange issue with two similar pieces of C++ code that are supposed to perform the same task but yield different results. The problem is around the inner loop statement . While ...
AyushRaj's user avatar
-1 votes
0 answers
74 views

Are namespaces in C++ the same as those in Python? [duplicate]

Namespaces in Python are "a mapping from names to objects". They're a pretty fundamental part of the language, even making it to The Zen of Python. As per cppreference, "namespaces ...
new__'s user avatar
  • 9
1 vote
1 answer
47 views

Absolute prevention of content pollution in output buffer

I have this following code that basically renders partials. However I was trying to find a way to prevent polluting $templatePath variable into the template (the variable is currently accessible from ...
Askalot's user avatar
  • 13
0 votes
0 answers
4 views

How to write a Powershell function that can evaluate "using expressions" both locally without WinRM and remotely through WinRM?

The new IT-issued developer laptops at my org are configured in such a way that fully enabling WinRM is a nightmare - I still can't figure it out. I try to work within lowest-common-denominator ...
Pxtl's user avatar
  • 943
1 vote
1 answer
76 views

C pointers: Function returns a pointer defined in its body [duplicate]

I'm learning C using the book C Programming: A Modern Approach and I have some doubts about the use of pointers and referencing an out-of-scope variables. I've put together three examples to ...
videbar's user avatar
  • 33
-1 votes
1 answer
42 views

Variable used inside function reported not used

This works fine: package main var foo string func main() { fn := func() { foo = "AAA" } fn() } But if we move the variable declaration inside main(): package main ...
Greendrake's user avatar
  • 3,714
1 vote
1 answer
73 views

Unqualified name lookup after using-directives in C++

From cppreference : From the point of view of unqualified name lookup of any name after a using-directive and until the end of the scope in which it appears, every name from namespace-name is visible ...
Rajdeep Sindhu's user avatar
1 vote
2 answers
108 views

Ambiguous variable reference in C++

I have this piece of code #include <iostream> namespace ns{ int a = 10; } using namespace ns; int a = 20; int main(){ std::cout << a; } As per my understanding, when std::cout &...
Rajdeep Sindhu's user avatar
1 vote
0 answers
89 views

How can I overload a constructor in a private nested class without getting a "Resource Not Found" error when I call Inherited Create?

I have a Managed Record named TEmail with a nested private class called TEmailForm that inherits from TForm. The idea is my email Record can create a modal form as needed for the user to type an email....
dallin's user avatar
  • 9,246
0 votes
1 answer
52 views

Variables in Try-Catch blocks with Powershell?

I have been trying to write a script in powershell that renames a file if it does not get transferred correctly through WinSCP. The script looks something like this: # Variables $error = 0 $...
Evan's user avatar
  • 9
0 votes
1 answer
60 views

SwiftUI My Classes dont get injected properly

Im fairly new to SwiftUI and Im trying to build a small game to get used to the syntax but I have the problem that I created a class and created 3 instances in the @main struct but when I try to use ...
KatMood's user avatar
-1 votes
0 answers
47 views

Change function's variable inside another function via argument [duplicate]

I want to find how to change a variable via a function that isn't the one that the variable initiated in using the other function's argument (to make it viable for many usages). Something along these ...
ariel's user avatar
  • 1

15 30 50 per page
1
2 3 4 5
1177