编译时出现[Error] untTool.pas(395): Left side cannot be assigned to(50分)

  • 主题发起人 主题发起人 御宇
  • 开始时间 开始时间

御宇

Unregistered / Unconfirmed
GUEST, unregistred user!
Inc(IconIndex);<br>&nbsp; if IconIndex=5 then begin<br>&nbsp; &nbsp; IconIndex := 1;<br>&nbsp; &nbsp; Inc(FlashCyle);<br>编译时出现;[Error] untTool.pas(395): Left side cannot be assigned to<br>
 
应该是上面的赋值问题,我想可能是Inc(FlashCyle);这句吧,换成<br>FlashCyle:=FlashCyle+1,看看。。。[:)]
 
由错误消息看应该是赋值问题,能将FlashCyle的类型说明白点吗
 
换成<br>flashcyle:=flashcyle+1;也不行
 
IconIndex : integer = 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Current Icon Index<br>&nbsp; FlashCyle : integer = 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// the Flash Icon Cycle times
 
begin<br>&nbsp;{ Inc(IconIndex)}<br>&nbsp;iconindex:=iconindex+1;<br>&nbsp; if IconIndex=5 then begin<br>&nbsp; &nbsp; IconIndex := 1;<br>&nbsp; &nbsp;{ Inc(FlashCyle)}flashcyle:=flashcyle+1;<br>&nbsp; &nbsp; if FlashCyle &gt; MaxFlashCycle then begin<br>&nbsp; &nbsp; &nbsp; FlashCyle := 1;<br>&nbsp; &nbsp; &nbsp; SetTimer(hWnd,1,2000,@TimerProcMain);// Active timer 2<br>&nbsp; &nbsp; &nbsp; KillTimer(hWnd,2); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Kill Self<br>&nbsp; &nbsp; &nbsp; // And then reback the Tray Icon!<br>&nbsp; &nbsp; &nbsp; hIcon := LoadIcon(hInstance,IconS[1]);<br>&nbsp; &nbsp; &nbsp; TrayIconEdit(hWnd,ID_TRAYICON,hIcon,'Hello, World!');<br><br>&nbsp; &nbsp; &nbsp; //SendMessage(0,WM_PAINT,0,0);<br>&nbsp; &nbsp; &nbsp; UpdateWindow(0);<br><br>&nbsp; &nbsp; &nbsp; exit;<br>&nbsp; &nbsp; end;<br>&nbsp; end;<br>&nbsp; hIcon := LoadIcon(hInstance,IconS[IconIndex]);<br>&nbsp; TrayIconEdit(hWnd,ID_TRAYICON,hIcon,'你有事情要做!:-)');<br>end;<br>编译出现:<br>[Warning] untTool.pas(160): Return value of function 'SetWindowInCenter' might be undefined<br>[Error] untTool.pas(396): Left side cannot be assigned to<br>[Error] untTool.pas(398): Left side cannot be assigned to<br>[Error] untTool.pas(399): Left side cannot be assigned to<br>[Error] untTool.pas(401): Left side cannot be assigned to
 
是变量还是常量呢?有没有只读保护的??。。。[:(]
 
你的IconIndex,FlashCyle是变量还是Const啊
 
谢谢<br>原来是const<br>
 
多人接受答案了。
 
后退
顶部