You can; I have done this routinely.
Unfortunately, I don't have my hubs running right now, or I would cut and paste a couple rules for you.
The thing you have to know is that setCode() and deleteCode() take arguments (parameters in RM). From the documentation:
deleteCode(codeposition) takes a single parameter, codeposition, which has to be a NUMBER.
setCode(codeposition, pincode, name) takes three parameters.
codeposition must be a NUMBER
pincode and name must be STRINGS
Yes, but there's a built-in driver for them, which supports setCode() and deleteCode() just fine.
Edit: Here's an example from @bravenel