Global-variables Questions
Ad
Changing global c variable inside a struct array
I have a case where i have defined a global struct array in a seperate header file that i want to be able to change from function in another file
Is there a conflict with keyword "extern" for a variable which is also defined in the same C file?
If i define a global variable in file1.c and also declare it using 'extern' in the same file, is that an error, or is it acceptable?
How to make a global variable or be able to access it in other files
So i have a nodejs project where i have a dynamic form which expands if the user clicks "add question". this functionality is done by my
Why is use of an array defined in File1 working in File2 (only declared there),even without "extern"?
Here i have two files externdemo1.c and externdemo2.c.in the first file,i have declared and initialized a character
JavaScript prevent changing exported object
Is there any way to prevent exported object to be changed later when it's imported ? i have my config.js helper that manages my config, and i
How to implement global variables in extends different from 'Application' and 'Activity'?
I'm trying to implement global variables in and android studio application that uses ble gatt services. i need to save a number received from ble
How to make variable be still defined after EventListener in reactJS?
I have problem with variable "icons" in my code. its initialized and defined in eventlistener scope but it is not defined after that scope so i
JavaScript: Global variable seems to be overwritten
I'm currently working on the following code which should only save the first position. anything detected afterwards should be ignored:
How to pass a GlobalKey through Stateless Widget Children
I'm trying to create a custom menu bar in my app. right now, the biggest issue i'm having is passing a state for when it's expanded to it's
I want to use few variables in other dart files. In short I want them to be globally accessed
Here there are two bool variables i want them to be used in other dart files. how can i achieve that. class employeeregistrationscreen extends
Ad
I want to save the updated value of global variable in notepad file and when i restart the server it should again start from the updated value
I have started the counter from 1. when i run the server the value of global variable increases as per while loop upto 9999. when i shut down the
Difference between Special Variable and Global Variable
In gnu clisp 2.49.92, the following code: (defvar i 1) (defun g () (format t "g0:~d~%" i) (setf i 2) (format t
Flutter Global Variable value gets set when list is filtered
Was not sure how to phrase this question but am struggeling with the following at the moment. i have a global variable as such:
How to use created variables in every class?
I have a widget where the user can input data like height, weight and so on in a textformfield like this: string weighttext;
Understanding variable scope in nested functions in Python
I have the following functions in python3.7 def output_report(): sheet_dict = {1: 'all', 2: 'wind', 3: 'soalr'}
How to create a reused variable in flutter,which needs to be initialized?
Following the example code void main() async { cloudbasecore core = cloudbasecore.init({'env': 'your-env-id'});
Android - My Global Variable values return null after switching Application
I am using globalvariable file to hold data during my entire application, but what happens is it returns null value if i switch to another
Lisp: Not retrieving the character at an index of a list correctly?
I am writing a program that recursively iterates through a list, provided the index of the current character and a list of characters. however,
How to create a global TextStyle in Flutter?
In my home page in build widget before return statement i use below code. if i create an another widget in my home page i have to copy below code
Changing a variable used in a class?
I'm using a variable as part of a string within a class, however printing the string shows what the variable had been set to at the start of the
accessing data from a static function globally
In the init() of my splash screen page, i am calling the function of the next page in order to load the data from backend, and meanwhile the
Ad
Window variables not accessible between Javascript files
I have two javascript files to handle my webpage login function. first js file authenticates the user and returns a session token which should be
Local and Global lists in Python
Please help me as i am new to python when i call this function the original value of list1 changes def
Best practice for fetching data from API periodically and provide it globally (for every Screen)
I'm working on a game-companion app and i was looking for a neat way to fetch data from multiple apis initiated by starting my app (and maybe also
Read files in mocha tests asynchronously?
I'm not getting the value of input and output variables. i have tried using this keyword also in the below code.
What is the best way to share variables with flutter?
I have these variables that i want to share it with another screen, what is the best way to share them beside pushing them ?
How to use global variables in other activities
I am trying to get the global variable from one class in another class, but it gets me just an empty string. class abfahrtsmonitor
How can I get constant variable with the global object in Nodejs?
I wanted to get a constant variable with the global
How do I change the variable from across page if the target page has no context?
'databasefunctions.dart' string path = 'path' // a variable needed to be modified across page future queryall() async { database
Import TypeScript variable in React
I am trying to style (styled-components) a fabric js component (dropdown) as a react component. the css class names are declared in a file
Global context in node-red to store http req and res objects
We are exploring node-red as an option for rapidly creating small utilities needed within our team. typical pattern we have is : 1)
How to create a next button with tkinter to switch between multiple frames
I am writing a quiz program in tkinter that has a frame for each question being asked. after the user selects the correct answer from a
Ad
Python thread doesn't change global variable inside a function
The most basic form of something i want to code is the code as follows: import threading arr = [] def test(id): global arr
How to update the value of global variable react native?
I want to update the value of bjpv and finally set it's state to new updated state, which i will get from the firebase
Assigning local reference to global
Here's what i can't understand. i have this function here function foo(){ let a = {a:1}; window.a = a; }
Why global variable is being reset in Laravel controller
I am trying to set a variable globally and then to add values in there but it's being reset, see below; class newtestcontroller
Node.js: accidentally omitted var declaration expose all variables via global object, bug or feature?
Fairly new to nodejs (however not to javascript) and i think it is great, not in all aspects but that is not the subject of the question.
Having problems with global variable in python and line api
I'm trying to build reply bot by using line api and python 2.7.15 . this is my code from flask import flask, request, abort from
Is this a scope error/leak in the JavaScript for-loop implementation of my browser or my misunderstanding?
If i run the code below it acts as expected. (expected being that both normal code languages and javascript have "local scope" in
How do I store an input as a global variable?
I am an absolute newbie when it comes to python and am learning by doing via my own text adventure game. i have some code that enables
Passing Values from Form to Form
I need to pass a data bound integer that is from a populated list in a combo box from one for to another. in form 2 i need the rest of the fields
Accessing the value of a private variable in a method and making it global
I have a method that gets a token from a login, in a class that also returns the token. i need to access the token's value in other classes. i.e.
Why Global variable does not update with global function within the same Global variable? Android/Java
For an application in android i have a global variable, public class constantsurls { public static string get_cart_all_item =
Ad
Example of extern global variable - Error
I'd like to understand which mistake i did in the following example. there are three file: main.c, libreria_mia.c and libreria_mia.h.
How to declare a global variable in an header file and how he need to be in the c file
I have a serious problem to understand how to declare a global variable in an header file and how he need to be in the c file. in my .h :
How to free a dynamic allocated array from another function without making that array global?
#include <stdio.h> char *mystrcat(char *s1, const char *s2); // prototype char *newstring; // global pointer int main(){
Get value from one function and put it into another function
I need to get the value of inputscore currently held in the extractvariable function into the assignvalue
Setting one variable equal to another in C
I am writing a code in c. it is in an environment with precoded functions, so i can't explain it completely. i wanted to iterate over a variable
Python: Calling predefined variables/list/etc. from user input
Thanks for your help in advance! i have the following problem in python (i use py 3.6.5): i have some lists, with some values in
Python Global Variables - Not Defined?
I'm running into an issue where a global variable isn't "remembered" after it's modified in 2 different functions. the variable df is
How to access the value of baseURL in Cypress
I'm just starting to learn javascript and have been using cypress to automate some regression tests. the test i writing currently is meant to
global scope in Julia
I have a piece of code in julia here: i = 1 while true if i == 10 break end global i += 1 #a
can't accesso to activity object from process global routine
I'm using b4a 11.20 and i need to use a variable in main on a service module. main code sub process_globals public targetprice as
How do I mock methods of global object in python?
I have a file say twitter.py in which i have two global objects: user and tweet. i have another file say twitter_utils.py in which i have
Ad
Laravel 5.5 : How to define global variable that can be used in all controllers ?
Hello developers & coders , my question is how to define a global variable , that can be used in all controllers in
Vba global variable declaration
In vba how to declare a global variable, which will be assigned from userform, but then used inside various sub procedures, functions in different
Creating objects within loop in Java
What is difference in creating a string object within the while loop, assign different values in each iteration and create string object outside
How to assign new values to global variable from inside a function
I want a function to assign a new value to a global variable: value = "" function edit_value(v::string) value = v
environmental variables vs. global variables
I am pretty new to shell scripting and python. while i was reading the materials, i saw the term "environmental variable" in shell and
How to expose a variable in app.vue globally in vue.js
I am using vuejs to develop a module of my application, i will be getting data which i need to set to a variable ex this.gbldata in the
Vue js 2 - Accessing data in App.vue from child components
I'm pretty new to vue and i'm trying to create my first app with it (i have worked through a whole tutorial though so it's not like i'm completely
how to create a shortcode from a variable in plugin
I'm using wp user frontend pro plugin i want to echo the pack title using a shortcode to put it in bakery visual. all what i know is : this is the
How to change global variables using globals() in python method?
If i have the following python script foo.py : def foo() : my_dict = {'a': 1, 'b': 2, 'c': 3} globals().update(my_dict)
Access global variable across multiple modules and threads
I have two python scripts which import each other and access a variable defined in the first script. but changes made to this variable are not
How can I make this javascript function not use a global variable?
This function toggles the active state of a hamburger icon when clicking on it. also clicking anywhere on the document does the same
Ad
Make the local variable to global in extjs
How to make local variable to global? ext.define('a.view.management', { extend: 'ext.container.container', requires: [
Global variable and static global variable
Is there any difference in c++ between global variable/const and global static variable/const? declared in cpp file or a header file.
Python: Referencing global variables inside a function
I came across this problem of not being able reference golbal variables from inside of a function. it always throws an error saying "local
PowerPC r13 Register Small Data Pointer Example in C Source Code
The r13 in ppc it's the small data area pointer register. what is an example in a c source code that will use this register?
What is the best way to declare global variables in Vue.js?
I need access to my hostname variable in every component. is it a good idea to put it inside data? am i
Using Ajax variable outside of function
I got below code and i want to use ajax response out side of function but it continuously shows me undefined, i know it is easy but how to handle
A variable to be stored in Java permanently, access and edit it later
Suppose there is a variable int a = 10; when i run the program again and access the data it's the same when i
How to manage global variables
I know this is very basic thing but i need to know that how can i declare / assign value / use global variables. because i have already
Modifying a variable in a function has no result
I have a tkinter application, so i have the mainloop which is typical of tkinter, and various functions which handle mouse clicks and
Changing the value of a global variable inside a function of parameter (x):
Def check(x): global username while true: if x.isalpha(): break else: x = input("please type
What's the conventional way to annotate globals in Javascript?
There's some convention for writing about globals in js that looks something like /* globals: foo, _ */ placed at the beginning of
Ad
React + Flux - How to avoid global variable
I have been working on react/flux and am confused over the declaration of variable outside the component as in below code. countercomponent.js
Ad
Blog Categories
Ad