StructKeyTranslate

Returns: number

Usage

StructKeyTranslate( structure [, deepTranslation [, leaveOriginalKey ] ] )

Arguments

Argument Description
structure
(struct, required)
deepTranslation
(boolean, optional)

also translate keys of child structures

leaveOriginalKey
(boolean, optional)

leave original key in struct

Examples

Member Function

animals = {
	cow: {
	    noise: "moo",
	    size: "large"
	},
	"bird.noise": "chirp",
	"bird.size": "small"
};

// Show all animals
Dump(
	label: "All animals",
	var: animals
);

// Call function
animals.keyTranslate();

// Show all animals after keyTranslate
Dump(
	label: "All animals after keyTranslate",
	var: animals
);

Non-Member Function

animals = {
	cow: {
	    noise: "moo",
	    size: "large"
	},
	"bird.noise": "chirp",
	"bird.size": "small"
};

// Show all animals
Dump(
	label: "All animals",
	var: animals
);

// Call function
StructKeyTranslate(animals);

// Show all animals after keyTranslate
Dump(
	label: "All animals after keyTranslate",
	var: animals
);

See also