使用ATOM为什么会出错?(20分)

  • 主题发起人 主题发起人 MichaelZhu
  • 开始时间 开始时间
M

MichaelZhu

Unregistered / Unconfirmed
GUEST, unregistred user!
各位专家,我在使用如下代码时,为什么会出错?<br>&nbsp; if GlobalFindAtom('PROGRAM RUNNING')=0 then<br>&nbsp; &nbsp; ATOM := GlobalAddAtom('PROGRAM RUNNING')<br>&nbsp; else<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; messagedlg('&amp;sup3;&amp;Igrave;&amp;ETH;ò&amp;Ograve;&amp;Ntilde;&amp;frac34;&amp;shy;&amp;Ocirc;&amp;Euml;&amp;ETH;&amp;ETH;!',mtwarning,[mbok],0);<br>&nbsp; &nbsp; &nbsp; halt;<br>&nbsp; &nbsp; end;<br>错误信息如下:<br>[Error] Main.pas(1001): '(' expected but ':=' found(即第二行)<br><br>分数不多,请见谅!
 
var xy: ATOM;<br>&nbsp; if GlobalFindAtom('PROGRAM RUNNING')=0 then<br>&nbsp; &nbsp; xy := GlobalAddAtom('PROGRAM RUNNING')<br>&nbsp; else<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; messagedlg('&amp;sup3;&amp;Igrave;&amp;ETH;ò&amp;Ograve;&amp;Ntilde;&amp;frac34;&amp;shy;&amp;Ocirc;&amp;Euml;&amp;ETH;&amp;ETH;!',mtwarning,[mbok],0);<br>&nbsp; &nbsp; &nbsp; halt;<br>&nbsp; &nbsp; end; &nbsp;//can't use ATOM as a bian liang<br>&nbsp;
 
////ATOM := GlobalAddAtom('PROGRAM RUNNING')<br>ATOM是关键字,时类型!!!<br>定义一个TATOM变量解决。
 
后退
顶部