IsSpreadsheetFile
Determines whether a file is a spreadsheet file.
Method Signature
IsSpreadsheetFile(filepath=[any])Arguments
Argument
Type
Required
Description
Default
value
ANY
true
The value to check.
Examples
Check if a value is a SpreadsheetFile fluent API object:
// Check if object uses fluent API
var spreadsheet = new SpreadsheetFile();
if ( IsSpreadsheetFile( spreadsheet ) ) {
println( "This is a fluent SpreadsheetFile object" );
}Distinguish between BIF and fluent API:
// BIF approach creates an object
var bifSpreadsheet = SpreadsheetNew();
// Fluent API approach
var fluentSpreadsheet = new SpreadsheetFile();
if ( IsSpreadsheetFile( fluentSpreadsheet ) ) {
println( "Using fluent API" );
} else if ( IsSpreadsheetObject( bifSpreadsheet ) ) {
println( "Using BIF approach" );
}Validate for fluent chaining:
// Ensure fluent API available for method chaining
function configureSpreadseet( obj ) {
if ( IsSpreadsheetFile( obj ) ) {
// Can use fluent API chaining
return obj.addRow( [ "Header1", "Header2" ] )
.formatRow( 1, { bold = true } );
}
return obj;
}Related
IsSpreadsheetObject() - Check for BIF spreadsheet objects
SpreadsheetFile Class - Fluent API documentation
SpreadsheetNew() - Create BIF spreadsheet
Type Checking Guide - BoxLang type validation
Last updated
Was this helpful?
