global-variables Questions

2

Solved

I need to get dynamically the current directory in which my .htaccess file is located. Is that possible ? (A variable maybe ?). Something like : %{SCRIPT_FILENAME} Thank you in advance. EDIT : I...
Prussia asked 4/3, 2013 at 10:45

8

I see most examples from Google is they use only functions in a single giant script. e.g. https://developers.google.com/apps-script/quickstart/macros But in our style, we usually write all funct...

5

I want to use a global variable, Init it once. having a thread safe access. Can someone share an example please?
Crater asked 20/2, 2013 at 11:57

26

Solved

How do I create or use a global variable inside a function? How do I use a global variable that was defined in one function inside other functions? Failing to use the global keyword where appropri...
Dissuasive asked 8/1, 2009 at 5:45

4

Solved

Is there a use for flagging a variable as static, when it lies in the global scope of a .cpp file, not in a function? Can you use the static keyword for functions as well? If yes, what is their us...
Descant asked 18/1, 2011 at 14:29

6

Solved

I am bit confused about these super global variable ($_POST, $_GET, and $_REQUEST) in PHP. In which scenario do I need to use these variables in PHP, and what are the main differences these three s...
Lingwood asked 22/3, 2017 at 4:4

4

Solved

I am working on a program for my CS class. It is a simulation of a delivery company's activities at an airport. This is a very simple, small program consisting of a few header and source files an...
Forsyth asked 19/9, 2011 at 6:34

10

Solved

For desktop application that is. This is just a general question that maybe only need general answers.
Disfeature asked 13/12, 2008 at 14:32

2

I need a global variable to be persistent across requests I'm aware of a similar question PHP Persist variable across all requests but I'm concerned about what solution performs better because as ...
Bargain asked 5/3, 2015 at 23:1

3

Let's say I want to create a global object called Hello and add the function world on that object, so that any other JavaScript library in the browser can simply call it with window.Hello.world(); ...
Dunnage asked 22/8, 2017 at 8:16

7

Solved

Is there a way for javascript to detect all assigned variables? For example, if one js file creates a bunch of vars (globally scoped), can a subsequent file get all the vars without knowing what th...
Dare asked 4/5, 2010 at 0:28

7

I created a WPF application in c# with 3 different windows, Home.xaml, Name.xaml, Config.xaml. I want to declare a variable in Home.xaml.cs that I can use in both the other forms. I tried doing pub...
Growl asked 21/7, 2009 at 20:2

8

Solved

What is the best way to define a constant that is global, i.e., available in all PHP files? UPDATE: What are the differences between constants and class constants? Can they be used interchangeably...
Lotson asked 21/5, 2012 at 19:30

1

I'm working on this Python module, which compounded from several files. Few of those files are actually independents, and meant to do a very specific job. I know for a fact that there will be only ...

8

Solved

I'm looking for a way to set the scope of require_once() to the global scope, when require_once() is used inside a function. Something like the following code should work: file `foo.php': <?ph...
Comedietta asked 23/1, 2012 at 15:2

13

Solved

I have a global variable in JavaScript (actually a window property, but I don't think it matters) which was already populated by a previous script, but I don't want another script that will run lat...

5

I'm learning the concepts of programming languages. I found the terminology "nonlocal" in python syntax. What is the meaning of nonlocal in python?

8

Solved

I'm coding a small program to time and show, in a ordered fashion, my Rubik's cube solvings. But Python (3) keeps bothering me about times being used prior to global declaration. But what's strange...

11

Solved

I'm working with this: GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) I have a script like below: #!/bin/bash e=2 function test1() { e=4 echo "hello" } test1 echo "$e" Whi...
Kotto asked 9/5, 2014 at 12:44

3

Solved

I have some global variables in Vue3 project defined like: app.config.globalproperties.$locale = locale then composable is created to dynamically return global variable: import { getCurrentInstan...
Lecialecithin asked 1/10, 2022 at 10:51

14

Solved

Most of the objections I see to using global variables make sense since they refer to issues of multiple threads, thread safety, etc. But in a small, single threaded, non-OS, case, what objections...
Acescent asked 16/5, 2009 at 18:9

2

Solved

I would like to load one script into redis that will export functions that future scripts executed will depend on, but attempt to define global function fails, same goes for global variables: redi...
Spoiler asked 15/11, 2013 at 9:27

1

Solved

There are plenty of questions and answers relating to C++ global variables, such as: static and extern global variables in C and C++ Global variables and constexpr (inline or not?) Is there any se...
Riser asked 29/8, 2023 at 11:0

2

Solved

Initially I was pretty sure that the correct answer had to be "None of them", since global variables are stored in the data memory, but then I've found this book from Robert Lafore, calle...
Aleutian asked 4/6, 2017 at 23:51

3

Solved

I have been using the Locals window to check the assignments for procedure level variables. I have recently updated my code to create a set of public-level variables that read certain inputs from ...
Fragonard asked 22/2, 2013 at 19:0

© 2022 - 2024 — McMap. All rights reserved.