UPDATE: Adds a bunch of documentation and examples
This commit is contained in:
19
base/examples/hello_world.rs
Normal file
19
base/examples/hello_world.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use ironcalc_base::{cell::CellValue, model::Model};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut model = Model::new_empty("hello-world", "en", "UTC")?;
|
||||
// A1
|
||||
model.set_user_input(0, 1, 1, "Hello".to_string());
|
||||
// B1
|
||||
model.set_user_input(0, 1, 2, "world!".to_string());
|
||||
// C1
|
||||
model.set_user_input(0, 1, 3, "=CONCAT(A1, \" \", B1".to_string());
|
||||
// evaluates
|
||||
model.evaluate();
|
||||
|
||||
assert_eq!(
|
||||
model.get_cell_value_by_index(0, 1, 3),
|
||||
Ok(CellValue::String("Hello world!".to_string()))
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user