Re: global variable Programming Software Development by dmanw100 Global variables are variables that are declared outside a function, meaning that they can be accessed anywhere in the program by any function. Any variable declared outside of int main() is a global variable. Using global variables is not good programming technique, although it can be done. Global variable Programming Software Development by jodie121997 …basisly in add_info_node() function will be used g_listItem which is global variable to add the new item(node) to the list. …Ideally I don't want to use global variable(g_listIem) in this API9add_info_node()). Is there any way to get… around for not using the global variable in this API(API9add_info_node()). Thanks, -J global variable? Programming Web Development by drumichael87 … to know what's the easier method.of declaring a global variable that I can use. As of now I am not… time in a variable that I can call like this : Global $results; Similar to how I call global $wpdb; When calling global $wpdb, am… I actually calling a class or a variable? I'm just a… global variable Programming Software Development by justinlake888 what is a global variable? is that when the variables are located outside of int ()?? Global variable problem? Programming Software Development by Leppie … works as it should with no problems. My variable, int hours, is a global variable but is not used by main, however when… I move this variable into my function, void dayNight (),(making… Re: Global variable problem? Programming Software Development by Sky Diploma …My variable, int hours, is a global variable but is not used by main, however when I move this variable …into my function, void dayNight (),(making it a local variable…complete. Therefore, everytime the function is called your variable int hours is created in the start with … [Global Variable] How to pass ? Programming Software Development by shayankhan … selected name in LISTBOX make a global variable and so that when i want variable i get from global variable ?? how can i do this… that was created in edit_button ... how can i pass this variable to save_edited button ?? [/COLOR] } [/CODE] Thanks In advance.. and my… Re: global variable not updating on seperate thread Programming Software Development by skp888 … pPixel[0]; // Store 1st Color In Temp Variable (Blue) pPixel[0] = pPixel[2]; //…just not as a thread, then everything works, and the // global variable is updated // ****************************************** //createBackFaceTextureThread(&unusedData); // ****************************************** // … global variable not updating on seperate thread Programming Software Development by skp888 … pointer to so that it can update a variable for me. when this function is called normally the…completely, but when it returns the variable is NOT updated. *NOTE that this variable is a global variable* now i was thinking (obviously… own stack created, and hence unable to access the variable? also, could it maybe be that some OpenGL functions… Re: Global Variable not the Same as Local Variable Programming Web Development by nauticalmac In this case, 'paycheck' is indeed 'global' and can be acessed from inside a function. Try this: … the danger of a function corrupting the global variable, it's safer to use a different variable inside the function (pcheck in the… as an 'argument' which turns its value into a local variable within the function. Re: Global Variable not the Same as Local Variable Programming Web Development by nauticalmac …instead of passing it in as a parameter, then your variable can be changed from inside the function. Many other …languages would not be able to access the variable paycheck from inside the function. Compare with the following: … case pc = pc - 10 has no effect on the global variable so the alert keeps showing 1200. I took a quick… Global Variable not the Same as Local Variable Programming Web Development by Siberian function check_alert (pcheck) { window.alert("You make $"+pcheck); } var paycheck = 1200; check_alert(paycheck); How can the function make an alert with the variable pcheck when the global variable is named paycheck, I'm confused ? Re: Global Variable not the Same as Local Variable Programming Web Development by Troy III > How can the function make an alert with the variable pcheck when the global variable is named paycheck, I'm confused ? Well, *argument… Re: Global Variable not the Same as Local Variable Programming Web Development by Siberian All that is happening is the global variable value is being passed to the function, correct ? The function check_alert has a parameter called (pcheck), it is a little confusing, but I'll get this figured out :) Re: Global Variable not the Same as Local Variable Programming Web Development by Siberian Now I understand. In your first example when the function was being called it would subtract 10 from the global variable since the function was not calling any parameters. I have to begin to take some of this knowledge and finish my site up, time is moving :( global variable in the form Programming Software Development by darkocean … which is getting data from mssql db. My first problem global variable antoher one different value. I think I need to like… global variable not working? Programming Web Development by azareth … noob. i just want to ask why doesn't this global variable not recognized by my functions .. ? the thing is i need… Re: global variable not working? Programming Web Development by azareth thnx for the idea .. i have fixed the problem already, i initialized the global variable Tableid = getTableID(tableID); and it works fine now .. Re: Global variable Help Programming Software Development by slate For clarification: Global variable is defined by giving it a value at zero …distinction if you want to change the value of the variable or just read it. for example in the following … means to change to object that is labelled by the global variable. For example globalvar=[1] def somefunt(): globalvar.append(2) … Re: global variable Programming Software Development by cabsjonel … ahhm! bro why do you say that avoid often using global variable is it cause a lot of memory but thanks anyway… Re: global variable Programming Software Development by selvaganapathy When u use global variable, u may face some problems . [URL="http://c2.com/… Re: global variable? Programming Web Development by akmozo … where id = 1"; $result = mysql_fetch_array(mysql_query($query)); function show_name(){ global $result; echo " client name : " . $result['name']; } function show_phone… Re: global variable? Programming Web Development by diafol I'd pass them to other functions via parameter as opposed to using global vars: function x($res){ ... } function y(){ .... $result = mysql_query(...); $p = x($result); ... } Slightly different for class methods. May not be suitable for all cases though. Re: global variable? Programming Web Development by drumichael87 Thanks so much. I can believe its as easy as just Declaring the variable outside of the other functions. :) Re: global variable shows null for first iteration of loop Programming Web Development by phorce … assign the output of the function to this global variable? In other words, your function "show_news… "title" => "" ); return $json_news; } global $json_news; $json_news = show_news(); var_dump($json_news); ?> // output // output… Re: global variable shows null for first iteration of loop Programming Web Development by ckchaudhary @phorce and @diafol : many thanks for helping out. I figured it out, read a little about global variables. inside my function i had to declare the variable $json_news as a global variable. That solved it. Re: Global variable Help Programming Software Development by TrustyTony global variables are available everywhere after their definiton in a module (and outside the module can be qualified by the module name) Declaring Global Variable breaking script? Programming Web Development by Carpetfizz …the use of a global variable. However, whenever I make a variable "global", the page…['term'])) { $x = $_POST['term']; connect(); global $result=tableGen($x); }//end main if echo "…is supposed to "catch" the global variable. <?php if(isset($_POST['send'])) {… External/global variable in C Programming Software Development by miskeen …ve one header file that is called "global.h" where my global variable is defined. In the other files, there'…s an include directive to "global.h". At… the moment, I'm using my variable in the C files without… Re: External/global variable in C Programming Software Development by gerard4143 This may not be 100% but I always though of global and external variables as indicators to the linker such that: global variable is available out side of the file its defined in. external variable is defined out side of the file its used in.