lua-users home
lua-l archive

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

Here's a snippet of the relevant class declarations. The LUA script hooks
into a compiled EXE/library that does the class-level processing.
C++ class clsid {
	const obj_document = 70;
	const obj_food = 72;
	const obj_pda = 50;

C++ class object {
	function item_in_slot(number) const;

Right now, code like this works fine:
	return my_object:item_in_slot(1) == 72

I'd like to be able to do something like:
	my_object:item_in_slot(1) == magically_get_value_of("obj_food")

> On Fri, 1 Jun 2007 07:28:33 -0700 (PDT)
> wrote:
>> Thanks. The "const" is part of a class definition. I left
>> that bit out for simplification, but the distinction may be
>> important. Can I still access the value through _G[] ?
> only if your class creates globals. it would be better to give us more
> details about your class definition part (perhaps a simplified source
> code?) so we can see what is inside the black box. %-)