[求助]关于eval的使用问题
<P>我在图形界面窗口中定义了四个edit控件,要将其中输入的数据传入pushapply函数中进行运算,pushapply()部分代码如下:<BR>function pushapply(hlineedit1x,hlineedit1y,hlineedit2x,hlineedit2y)<BR>global FileName;<BR>global x1;<BR>global g;<BR>hx=get(hlineedit1x,'string'); %获得输入的字符串函数 <2> <BR>hy=get(hlineedit1y,'string');<BR>vx=get(hlineedit2x,'string'); <BR>vy=get(hlineedit2y,'string');<BR>string1= 'f1=';<BR>string2=';';<BR>user_entry1=;<BR>eval(user_entry1');<BR>string1= 'g1=';<BR>string2=';';<BR>user_entry2=;<BR>eval(user_entry2');<BR>string1= 'f2=';<BR>string2=';';<BR>user_entry3=;<BR>eval(user_entry3');<BR>string1= 'g2=';<BR>string2=';';<BR>user_entry4=;<BR>eval(user_entry4');<BR>......<BR>可是运行时出现下面的错误:<BR>??? Error: Incomplete or misformed expression or statement.</P><P>Error in ==> pushapply at 16<BR>eval(user_entry2');</P>
<P>??? Error while evaluating uicontrol Callback.</P>
<P>??? Error: Incomplete or misformed expression or statement.</P>
<P>Error in ==> pushapply at 20<BR>eval(user_entry3');</P>
<P>??? Error while evaluating uicontrol Callback.</P>
<P>??? Error: Incomplete or misformed expression or statement.</P>
<P>Error in ==> pushapply at 24<BR>eval(user_entry4');</P>
<P>??? Error while evaluating uicontrol Callback.<BR><BR>请问这是什么问题,谢谢指教!</P>
回复:(dxwwangyan)[求助]关于eval的使用问题
去掉string2 看不懂啊,水平太低啊。郁闷了。我也需要用这个函数啊。 1F我在图形界面窗口中定义了四个edit控件,要将其中输入的数据传入pushapply函数中进行运算,pushapply()部分代码如下:function pushapply(hlineedit1x,hlineedit1y,hlineedit2x,hlineedit2y)
global FileName;
global x1;
global g;
hx=get(hlineedit1x,'string'); %获得输入的字符串函数 <2>
hy=get(hlineedit1y,'string');
vx=get(hlineedit2x,'string');
vy=get(hlineedit2y,'string');
string1= 'f1=';
string2=';';
user_entry1=;
eval(user_entry1');
string1= 'g1=';
string2=';';
user_entry2=;
eval(user_entry2');
string1= 'f2=';
string2=';';
user_entry3=;
eval(user_entry3');
string1= 'g2=';
string2=';';
user_entry4=;
eval(user_entry4');
......可是运行时出现下面的错误:
??? Error: Incomplete or misformed expression or statement.
Error in ==> pushapply at 16
eval(user_entry2');
??? Error while evaluating uicontrol Callback.
??? Error: Incomplete or misformed expression or statement.
Error in ==> pushapply at 20
eval(user_entry3');
??? Error while evaluating uicontrol Callback.
??? Error: Incomplete or misformed expression or statement.
Error in ==> pushapply at 24
eval(user_entry4');
??? Error while evaluating uicontrol Callback.
请问这是什么问题,谢谢指教!
页:
[1]