Getting Started
Add vb6runtime to your Rust project by including it as a dependency. It is designed as a foundation for VB6 analysis, conversion, and migration tools.
Installation
Add to Cargo.toml
[dependencies]
vb6runtime = "0.2"
Build from workspace
cargo build -p vb6runtime
Using the Library
Call a function
use vb6runtime::boundary::arg;
use vb6runtime::value::{VBVariant, VBString};
use vb6runtime::library::string::len;
// Call len("Hello")
let input = VBString::new("Hello");
let args = [VBVariant::from(input)];
let result = len(&args).unwrap();
println!("Length: {}", result); // prints 5
Use runtime state
use vb6runtime::state;
// Get current date
let date = state::clock::get();
// Set error number
state::err::set_number(6); // Overflow
let current = state::err::current_number(); // 6
Category Reference
| Category | Functions | Key Functions |
|---|---|---|
string |
40+ | len, left, mid, instr, chr, asc |
file |
33 | open, close, get, put, print, dir |
datetime |
22 | date, time, now, dateadd, datediff |
math |
12 | abs, round, int, fix, rnd |
financial |
11 | pmt, fv, pv, nper, npv |
conversion |
6 | cverr, hex$, oct$, vartype |
See the Library Reference for complete documentation of all 194 functions.