Skip to main content

All Questions

Tagged with
-4 votes
1 answer
98 views

What functions can access a global variable that appears in the same file with them?

I asked ChatGPT and Google Bard a C++ question that "What functions can access a global variable that appears in the same file with them?" They answered that "Any function within the ...
MudassaRXaeed's user avatar
0 votes
3 answers
144 views

Universal function like Start() in Unity C#

I am creating a multiplayer system for unity that is aimed towards people who don't want to mess with anything with networking. To simplify it, I want to create universal functions (for lack of a ...
The Epic Bacon's user avatar
0 votes
0 answers
83 views

Global vs. local scope at `(new Function()).call(...)`

my Problem seems to be in my module.js. It seems the evaluateJavaScript() function calls my script modules correctly: the this in the module is a reference to the new Module() object (within Module....
Sebastian's user avatar
0 votes
1 answer
93 views

Python not using global variable in function even when global command is used

I am trying to change the value of a global variable in a function, however this is not happening even when "global" is specified before attempting to use/alter the variable. Here is an ...
Toz H.'s user avatar
  • 3
-3 votes
1 answer
109 views

local variables outside a function in python [duplicate]

i have a code that goes like this def inputs(): q_number = int(1) number_of_q = int(0) q = {} x = {} y = {} xxxx = 1 for i in range(4): C = float(qq[xxxx].get()) ...
Meat_Mr8h's user avatar
0 votes
0 answers
28 views

How do i put a variable from one javascript function to display via another javascript function on an html site [duplicate]

Im trying to make it so that when i click 'submit', my data gets stored in variables and then when i click 'show' the data gets displayed this is my js code: var Usrname = ""; var Passwrd = &...
lukas Tori's user avatar
1 vote
1 answer
54 views

How do I efficiently access functions by index in Julia?

I havea set of functions that I want to use on some data. Currently, I am storing these functions in a global array to be able to index them. const global _rot01(x)::Tuple{Int64, Int64, Int64} = ( x[1]...
TheOneAndOnlyMrX's user avatar
0 votes
2 answers
66 views

PHP - Way to call a function that creates variables outside in calling context?

I'd like to pull all the names of fields from a submitted form, and create variables from them automatically. Not much of a problem as my code1 below shows. BUT I'd now like to put the code in a ...
URi613's user avatar
  • 41
1 vote
1 answer
64 views

Does python redefine guess of variable scope inside function?

I have a simple example that is confusing me, concerning local and global scopes in functions. a=1 def func(): print(a) # Error: local variable 'a' referenced before assignment a=2 print(...
Mike Smith's user avatar
1 vote
1 answer
51 views

Function to exchange value between variables

I am trying to write a function that makes "transactions" between "adresses" (variables) by exchanging values between them. I want to make it so that I can just write the reciever ...
anon's user avatar
  • 11
0 votes
0 answers
27 views

Local variable referenced before assignment. Global Variable not read inside function. [Python 3.7]

I have two global variables being declared just outside a function. When I try to access their values just inside the function, one of them gets identified while the other fails to get accessed. [...
Ratul's user avatar
  • 51
-4 votes
1 answer
27 views

Best practice for using Returned Value on Function Call

Made a basic Python for my utility and it was the first project I made learning how to code, I know it's messy, that's why I am here. In this program, the button below "Upload XML File" ...
phaynes's user avatar
  • 15
0 votes
0 answers
53 views

Add values into a list

Hope you're all good. So, I have this code where at the end, I'd like to append values to a global list, but when I call the list, it returns an empty list. It's not adding the values that the ...
Angel Panda's user avatar
0 votes
2 answers
110 views

Python - how to access values assigned to variables in one function from a different function that returns multiple variable values

New to Python and trying to move away from using the global keyword as part of passing variable values between functions. I understand that return returns a tuple - but I'd like to be able to ...
formerlolz's user avatar
0 votes
1 answer
154 views

extract pine script function data

sample code please to extract data frm functions in a library? thanks using trading view zigzag library I need to extract data from it's functions httpswww.tradingview.comscriptbzirugxc-zigzag
quantisimo's user avatar

15 30 50 per page
1
2 3 4 5
31