http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifiers in C++



oops. i think i got the wrong end of the stick there... don't know why, but
i thought this was a function question.
anyway, you can do it for variables the same way i suggested earlier, with a
few modifications. try it, see where you get to, report back if you get
stuck.
of course, this is only if you know what the variable names are going to be.
if you don't (i.e. if you want variable names to be defined at runtime) then
you really have to use an array, or something, to create your own symbol
table and go from there.

sorry about the earlier confusion. ;)

andy

--

Andy Burgess, Software Engineer.
Information Systems Production Software - 'PA' Listings.
eMail: andrewjb@padd.press.net
Phone: (01430) 488 224

----- Original Message -----
From: Karl Brehme <Karl@1planning.com.br>
To: <gameprogrammer@gameprogrammer.com>
Sent: Tuesday, September 14, 1999 1:36 PM
Subject: RE: Identifiers in C++


I think not.... not in normal ways... nor function or macro inside VC....

But you can try to construct your own... making indexes inside tables in
memory.... but.... is really complex, I think, considering that the eval
function of javascript, for example, that makes it, is a kind of function
that compiles on the fly the string... that can be watheer command line,
function, variable, from your code or from wathever function of all
APIs......

or.... change do Java... if JavaScript has it... Java maybe has it too...

Karl Heinz Brehme

-----Original Message-----
From: gameprogrammer-owner@gameprogrammer.com
[mailto:gameprogrammer-owner@gameprogrammer.com]On Behalf Of Ash
Stirling
Sent: Terça-feira, 14 de Setembro de 1999 07:58
To: gameprogrammer@gameprogrammer.com
Subject: Identifiers in C++


Hi,

  I'm trying to reference a variable by the contents of a variable.  That
is,

     x = "myVar";
y = myClass.(x);

  where the desired result is to have 7 = myClass.myVar .  Is this possible
under (MS) Visual C++ 4.0?  If I can do this, it will same me a lot of time
and will make my program much more flexible.  Thanks in advance.


Ash David Stirling                    Email: (ashley@roadrunner.nf.net)
Department of Computer Science Phone: (709) 739-0022
Memorial University of Newfoundland
St. John's, Newfoundland, Canada
=================================================================
To SUBSCRIBE or UNSUBSCRIBE please visit
http://gameprogrammer.com/mailinglist.html
======================
To SUBSCRIBE or UNSUBSCRIBE please visit
http://gameprogrammer.com/mailinglist.html

=================================================================
To SUBSCRIBE or UNSUBSCRIBE please visit
http://gameprogrammer.com/mailinglist.html