GetFibonacciDescription
Syntax
GetFibonacciDescription(objectName: string, index: number): stringParameters
Return Value
Description
Example
// Get description for a specific Fibonacci level
try {
const description = this.api.GetFibonacciDescription("MyFibo", 2);
console.log(`Level 2 description: ${description}`);
} catch (error) {
console.log("Error:", error.message);
}
// Get descriptions for all levels
try {
// Assuming 8 standard Fibonacci levels (0-7)
for (let i = 0; i < 8; i++) {
const description = this.api.GetFibonacciDescription("MyFibo", i);
console.log(`Level ${i} description: ${description}`);
}
} catch (error) {
console.log("Error:", error.message);
}
// Example with error handling for different scenarios
function getFiboDescription(objectName: string, level: number): string {
try {
return this.api.GetFibonacciDescription(objectName, level);
} catch (error) {
if (error.message.includes("not found")) {
return "Fibonacci object not found";
}
if (error.message.includes("does not have levels")) {
return "Object is not a Fibonacci tool";
}
if (error.message.includes("out of bounds")) {
return "Invalid level index";
}
return "Unknown error";
}
}Last updated