I've been using this to encode, then a simple direct_output to write it

Code:
    Function Base64EncodeString String sText Returns String
        Address pBase64
        String sResult
        Integer iVoid
        Move (Base64Encode(AddressOf(sText), Length(sText))) to pBase64
        Move pBase64 to sResult
        Move (Free(pBase64)) to iVoid    
        Function_Return sResult    
    End_Function