; docformat = 'rst' ;+ ; Batch file containing all the code intended to be typed at the command line ; from the "External development" chapter. ;- ; SPAWN $pwd spawn, 'uname', platform print, platform mg_run_python, 123 mg_run_python, 'Pizza' ; CALL_EXTERNAL mg_make_dll, 'mg_callex_total.c' r = call_external('mg_callex_total.so', 'mg_callex_total', findgen(10), 10, /f_value, /auto_glue) print, r ; Dynamically loadable modules help, /dlm help, !make_dll, /structure mg_make_dll, 'mg_example_dlm.c' mg_make_dll, 'mg_example_dlm.c', /platform_extension help, /dlm print, mg_float_total(findgen(10)) print, mg_float_total(indgen(10)) a = 5 mg_varinfo, a mg_varinfo, 5 mg_varinfo, findgen(10) mg_varinfo, { a: 0 } mg_print, 'Boulder', 77., format='The temperature in %s is %0.1f today.' print, 'Boulder', 77., format='(%"The temperature in %s is %0.1f today.")' ; Bridges x = obj_new('IDLJavaObject$java_math_bigdecimal', 'java.math.BigDecimal', $ '12345678901234567890.123456789') help, x y = obj_new('IDLJavaObject$java_math_bigdecimal', 'java.math.BigDecimal', $ '12345678901234567890.123456789') z = x->multiply(y) help, z print, z->toString() print, 12345678901234567890.123456789 * 12345678901234567890.123456789, format='(F0.20)' obj_destroy, [x, y, z] idl_session = obj_new('IDL_IDLBridge') a = 5 idl_session->execute, 'help, a, output=output' output = idl_session->getVar('output') print, output idl_session->setVar, 'a', a idl_session->execute, 'help, a, output=output' output = idl_session->getVar('output') print, output obj_destroy, idl_session