In computer programming, a global variable is a variable that is accessible in every scope (unless shadowed). Interaction mechanisms with global variables are called global environment (see also global state) mechanisms. The global environment paradigm is contrasted with the local environment ...

learn more… | top users | synonyms (1)

0
votes
1answer
23 views

Getting data from JSON file value is 'undefined'

I'm trying get values from JSON file, the data stored in form of array.. Here is the code: JS: var initDate = new Date("7/9/2013"); var diffDays = 0; var timeS; function taqvimSingleDate() { // ...
0
votes
1answer
15 views

Variable scope for global inside functions

Let us ignore the bad design and ponder the use of a variable which is global inside a function, but not global in the default namespace: a(); function a() { function b() { global $x; ...
0
votes
0answers
46 views

should i always lock the global data in multi-thread programming, why or why not?

I'm new to multi-thread programming(actually, i'm not a fresh man in multi-threading, but i always use global data for reading and writing thread, i think it makes my code ugly and slow, i'm eager to ...
0
votes
3answers
43 views

Python - Global name not defined when it is

Hey there I've been stumped by this simple error for the past day and haven't been able to get passed it. This is the part of the code I'm getting this error message: Exception in Tkinter callback ...
0
votes
4answers
33 views

python global variable not defined in for loop

This code gives the error: UnboundLocalError: local variable 'LINES' referenced before assignment but LINES is clearly initialized since if I comment out the line below the print statement it throws ...
0
votes
0answers
9 views

Custom functions do not work in Wordpress

I always use this kind of function for my custom websites. If I use this function in my php files and in my websites, it works, but not in Wordpress: <?php function tester2() { global $pol; ...
1
vote
1answer
22 views

How do you set global variables in a Chrome extension? [duplicate]

I am making yet another extension for Chrome and I don't know how to set global variables, which are crucial for my extension. I have created my options page and set the localStorage variables and ...
0
votes
0answers
15 views

global variable in asp.net mvc 4 across all views

Good day, I want to make a global variable of a string for the src location of my css files so that i don't have to type it out every time, and if I change the position of it then i just need to ...
0
votes
1answer
22 views

Using a Superglobal as a Default Function Parameter in PHP

There are multiple ways I can conceive for achieving the following functionality; however I am hoping for a super elegant solution. Can I use a PHP superglobal variable as the default value for a user ...
0
votes
2answers
32 views

Does code execution wait for Ajax response?

Basically I have correctData = false//global variable function calledFirst() { xmlhttp.onreadystatechange=function() { if(xmlhttp.readyState == 4 && xmlhttp.status ...
2
votes
2answers
44 views

Lesser of two evils when using globals via extern

I'm working with some old code that uses many global variables. I'm fully aware of many of the disadvantages of using global variables, so my question is not about whether I should be using global ...
0
votes
1answer
33 views

Passing global Javascript variables through callback functions to other JS files

So I have an interesting problem. I declare a global variable before referencing other Javascript files, but the variable does not seem to carry through. Maybe I am missing a step somewhere? The ...
0
votes
2answers
34 views

The variable doesn't work as a global var in jquery

I am going to write a simple "slider plugin" for jquery. I have 3 images in the name of "1.jpg" "2.jpg" and "3.jpg" that are located in folder "Images". I need them accordingly be shown in the div ...
-3
votes
3answers
37 views

Using global variables with strict pragma in Perl

I was wondering if I could use some globals variables while using strict pragma. For example, I've tried to do this: #!/usr/bin/perl -w use strict; sub print_global{ print "your global is: ...
1
vote
1answer
29 views

Setting data to global variable

I'm currently using Koush/ion - https://github.com/koush/ion library for my app. I have a Global Variable set up public static String content; And using this method in an AsyncTask ...

1 2 3 4 5 154
15 30 50 per page