🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #477

Re: Sharing a variable through my project in BC++ 5.02

#477
From: Julius Lancer
Date: Mon, 02 Feb 1998 00:00
40 lines
1986 bytes
In article <MPG.f3f021a49d3df279896a3@news.edmonton.telusplanet.net>, adamst@telusplanet.net (Trenton D. Adams) wrote:
>I used AppExpert to create a basic application.  I then modified, and 
>added things that I wanted.  I have gotten all of my Dialogs and 
>everything working.  
>
>My question now is this.  How the heck do I make a variable that will 
>keep it's value through my whole program?  I thought this would be very 
>simple to figure out but nothing seems to work.  Here is an example of 
>what I want.  My Application object is in a Header, and a CPP file.  My 
>Dialog boxes are all in their own Header, and cpp files also.  How do I 
>get a variable that will be shared between all of them?

Two choices:

1. Declare the variable "static" within a function.
2. Declare the variable  outside of a function. To access the variable form 
another file declare the variable again with "extern".

John - N8086N
Organizer and Executive Vice President of the 
"Vast Right-Wing Conspiracy"

------------------------------------------------
Home Page:
http://home.att.net/~miano

Home of the Delphi Component Writers' FAQ

EMail Address:
|m.i.a.n.o @    |
|w.o.r.l.d.n.e.t . |
|a.t.t .| 
|n.e.t |


Full Name:
-------------------
-J.o.h.n?M.i.a.n.o-
-------------------
Technical Details
Message-ID: <6b4r80$7c@bgtnsc03.worldnet.att.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <MPG.f3f021a49d3df279896a3@news.edmonton.telusplanet.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8d38,cc5639ecc55682f1
X-Google-Attributes: gidf8d38,public
X-Google-Thread: 109fba,cc5639ecc55682f1
X-Google-Attributes: gid109fba,public
X-Google-Thread: 114592,cc5639ecc55682f1
X-Google-Attributes: gid114592,public
From: postmaster@0.com (Julius Lancer)
Subject: Re: Sharing a variable through my project in BC++ 5.02
Date: 1998/02/02
Message-ID: <6b4r80$7c@bgtnsc03.worldnet.att.net>
X-Deja-AN: 321383061
References: <MPG.f3f021a49d3df279896a3@news.edmonton.telusplanet.net>
Organization: AT&T WorldNet Services
Newsgroups: alt.comp.lang.learn.c-c++,borland.public.cpp.language,comp.lang.c++