8 Topics

Member Avatar for
Member Avatar for walid86

i'm writing some values which are global to the whole app. these values can change depending on the user. [CODE] // create GLOBAL SETTINGS public static class MyGlobals { public static string userName = "userName"; public static string pdfPath = @"C:\mypdfs\"; // deafult value, changes public static string FontName = …

Member Avatar for skatamatic
0
172
Member Avatar for jmalbornoz

Hi, I have been programming in C for some time and now I am trying my hand at C++. As we all know, global variables are baaaaad... However, I am developing a collection of classes and I need them all to share a common variable (a time step) whose value …

Member Avatar for jmalbornoz
0
3K
Member Avatar for Kniggles

Hello , I am stuck on this line of code [CODE]echo $hits[0];[/CODE] i am trying to get it to echo into a text box as an integar. at the moment the code [CODE]<?php $count_my_page = ("hitcounter.txt"); $hits = file($count_my_page); $hits[0] ++; $fp = fopen($count_my_page , "w"); fputs($fp , "$hits[0]"); fclose($fp); …

Member Avatar for tomato.pgn
0
210
Member Avatar for Kniggles

[CODE]<?php include ("counter.php"); ?><HTML><HEAD><?php function sidney() { global $id; include 'counter.php'; } sidney(); echo "$id"; ?><META name=GENERATOR content="MSHTML 8.00.7600.16722"> </HEAD><BODY><INPUT value='[$id]' name="player number"></BODY></HTML>[/CODE] please can you explain why [$id] dos not echo a number ? thanks.

Member Avatar for Kniggles
0
134
Member Avatar for subith86

while i was learning about global variables I did some trials and found one problem. Here goes my code. [CODE]int cows = 10; //global variable void farm1() { int cows; cout<<"in farm1, cows="<<cows<<endl; cows++; } int main() { //cout<<"in main, cows="<<cows<<endl; farm1(); //cout<<"back in main, cows="<<cows<<endl; } [/CODE] Here line …

Member Avatar for mike_2000_17
0
186
Member Avatar for mingler

I have a problem with using globals within class scope. For example: [ICODE] $GLOBALS['test'] = "How are you?"; class great { [INDENT]function grace() { [INDENT] echo $test; echo $GLOBALS['test']; [/INDENT]} [/INDENT]} [/ICODE] Problem is, that neither of the echos produce any output. Is there a problem with accessing superglobals from …

Member Avatar for mingler
0
141
Member Avatar for Towlie

I have two pages. In one page I am changing the value of a variable called t, in the other I am outputting it. The problem I'm having is in changing its value. Any help will be greatly appreciated. [code=html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" …

Member Avatar for Thirusha
0
165
Member Avatar for TrueVb.NetNoob

Hi Everyone! I have been experiencing problems in displaying my varibable Gcoins in form3 from form1. here is what i have in my form3 code. [CODE] Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim frm1 As New Form1 Dim points As Integer gcoinsamount = Val(frm1.Label2.Text) …

Member Avatar for TrueVb.NetNoob
0
253

The End.