1 NX9+VS2012 2 3 #include <uf.h> 4 #include <uf_modl.h> 5 6 UF_initialize(); 7 8 //创建一个新的表达式,有TAG 9 tag_t NewExpTag = NULL_TAG; 10 UF_MODL_create_exp_tag("DMM=151.5", &NewExpTag); 11 12 //输入表达式名称,获取它的名称和值 13 char ExpDefn[UF_MAX_EXP_BUFSIZE+1]; 14 UF_MODL_ask_exp("DMM", ExpDefn); 15 16 lw->Open(); 17 lw->WriteLine(ExpDefn); 18 19 /* 20 //提取左值右值 21 char BufLeft[256], BufRight[256];//左值,右值 22 23 //提取左右值 24 string S1 = ExpDefn; 25 string Strleft = (S1.substr(0, S1.find("=")));//提取左值 26 string Strright = (S1.substr(S1.find("=") + 1, S1.find(" ")));//提取右值 27 28 //将string类型转换为字符数组 29 strcpy(BufLeft, Strleft.c_str()); 30 strcpy(BufRight, Strright.c_str()); 31 32 lw->WriteLine(BufLeft); 33 lw->WriteLine(BufRight); 34 */ 35 36 37 UF_terminate();