Changeset 2781


Ignore:
Timestamp:
Feb 6, 2012 9:27:47 AM (11 years ago)
Author:
dkearney
Message:

updating R bindings return values.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/lang/R/functions_examples.R

    r2780 r2781  
    33
    44lib = rp_lib("driver.xml")
    5 lib
     5cat("lib = ",lib,"\n")
    66
    77ee = rp_lib_get_string(lib,"input.string(ee).current")
    8 is.character(ee)
    9 ee
     8cat("ee = ",ee," is.character = ",is.character(ee),"\n")
    109
    1110dd = rp_lib_get_double(lib,"input.number(temperature).current")
    12 is.real(dd)
    13 dd
     11cat("dd = ",dd," is.real = ",is.real(dd),"\n")
    1412
    1513ii = rp_lib_get_integer(lib,"input.integer(ii).current")
    16 is.integer(ii)
    17 ii
     14cat("ii = ",ii," is.integer = ",is.integer(ii),"\n")
    1815
    1916bb = rp_lib_get_boolean(lib,"input.boolean(bb).current")
    20 is.logical(bb)
    21 bb
     17cat("bb = ",bb," is.logical = ",is.logical(bb),"\n")
    2218
    23 ff = rp_lib_get_file(lib,"input.string(ee).current","myoutfile")
    24 is.integer(ff)
    25 ff
     19nbytes = rp_lib_get_file(lib,"input.string(ee).current","myoutfile")
     20cat("nbytes = ",nbytes," is.integer = ",is.integer(nbytes),"\n")
    2621
    27 ps = rp_lib_put_string(lib,"output.string(ps).current","voodoo",TRUE)
    28 is.integer(ps)
    29 ps
     22err = rp_lib_put_string(lib,"output.string(ps).current","voodoo",TRUE)
     23cat("err = ",err," is.integer = ",is.integer(err),"\n")
    3024
    3125d = as.real(12.45)
    32 pd = rp_lib_put_double(lib,"output.number(ps).current",d,TRUE)
    33 is.integer(pd)
    34 pd
     26err = rp_lib_put_double(lib,"output.number(ps).current",d,TRUE)
     27cat("err = ",err," is.integer = ",is.integer(err),"\n")
    3528
    3629pf = rp_lib_put_file(lib,"output.string(pf).current","myoutfile",FALSE,FALSE)
    37 is.integer(pf)
    38 pf
     30cat("err = ",err," is.integer = ",is.integer(err),"\n")
    3931
    4032result = rp_lib_result(lib)
    41 is.integer(result)
    42 result
     33cat("result = ",result," is.integer = ",is.integer(result),"\n")
    4334
    4435result = rp_units_convert_double("0C","F")
    45 is.real(result)
    46 result
     36cat("result = ",result," is.real = ",is.real(result),"\n")
    4737
    4838show = TRUE
    4939result = rp_units_convert_string("100mm","m",show)
    50 is.character(result)
    51 result
     40cat("result = ",result," is.character = ",is.character(result),"\n")
    5241
    5342show = FALSE
    5443result = rp_units_convert_string("100mm","m",show)
    55 is.character(result)
    56 result
     44cat("result = ",result," is.character = ",is.character(result),"\n")
    5745
    5846percent = as.integer(56)
    5947result = rp_utils_progress(percent,"almost done...")
    60 is.integer(result)
    61 result
     48cat("result = ",result," is.integer = ",is.integer(result),"\n")
    6249
    6350result = rp_utils_progress(76,"almost done...")
    64 is.integer(result)
    65 result
     51cat("result = ",result," is.integer = ",is.integer(result),"\n")
    6652
    6753result = rp_utils_progress(36.546,"almost done...")
    68 is.integer(result)
    69 result
     54cat("result = ",result," is.integer = ",is.integer(result),"\n")
  • trunk/lang/R/Rappture/src/RpLibraryRInterface.cc

    r2709 r2781  
    464464
    465465
    466     INTEGER(ans)[0] = 1;
     466    INTEGER(ans)[0] = 0;
    467467
    468468    UNPROTECT(1);
     
    554554                 appendVal);
    555555
    556     INTEGER(ans)[0] = 1;
     556    INTEGER(ans)[0] = 0;
    557557
    558558    UNPROTECT(1);
     
    642642             appendVal);
    643643
    644     INTEGER(ans)[0] = 1;
     644    INTEGER(ans)[0] = 0;
    645645
    646646    UNPROTECT(1);
     
    739739                 appendVal);
    740740
    741     INTEGER(ans)[0] = 1;
     741    INTEGER(ans)[0] = 0;
    742742
    743743    UNPROTECT(1);
Note: See TracChangeset for help on using the changeset viewer.