关于';'expected but'.'found的错误
我按书上写的设置了几个组件,参数如下
Table的DatabaseName为DBDEMOS,TableName为指定数据库,Active为True,把DataSource的DataSet设为Table1,把DBNavigator和DBGrid的DataSource设为DataSource1对数据源的OnStateChange编写如下代码:case DataSource1.DataSet.State of
dsBrowse : Caption :='Browse';
dsEdit : Caption :='Edit';
dsInsert : Caption:='Insert';
else
Caption:='Other State';可一运行就出现如下错误:
[Error]Unit1.pas(39):';'expected but'.'found
[Error]Unit1.pas(41):Declaration expected but end of file found
[Fatal Error]Project1.dpr(5):Could not compile used unit 'Unit1.pas'我将人为添加的
case DataSource1.DataSet.State of
dsBrowse : Caption :='Browse';
dsEdit : Caption :='Edit';
dsInsert : Caption:='Insert';
else
Caption:='Other State';
一删除,程序就能运行,也就是说问题出在这几行代码上了,可我实在是看不明白人家的错误提示,请高手讲解一下系统给出的错误提示是什么意思,我的代码应当如何改,谢谢了。
我按书上写的设置了几个组件,参数如下
Table的DatabaseName为DBDEMOS,TableName为指定数据库,Active为True,把DataSource的DataSet设为Table1,把DBNavigator和DBGrid的DataSource设为DataSource1对数据源的OnStateChange编写如下代码:case DataSource1.DataSet.State of
dsBrowse : Caption :='Browse';
dsEdit : Caption :='Edit';
dsInsert : Caption:='Insert';
else
Caption:='Other State';可一运行就出现如下错误:
[Error]Unit1.pas(39):';'expected but'.'found
[Error]Unit1.pas(41):Declaration expected but end of file found
[Fatal Error]Project1.dpr(5):Could not compile used unit 'Unit1.pas'我将人为添加的
case DataSource1.DataSet.State of
dsBrowse : Caption :='Browse';
dsEdit : Caption :='Edit';
dsInsert : Caption:='Insert';
else
Caption:='Other State';
一删除,程序就能运行,也就是说问题出在这几行代码上了,可我实在是看不明白人家的错误提示,请高手讲解一下系统给出的错误提示是什么意思,我的代码应当如何改,谢谢了。
解决方案 »
- cxgrid中combobox的itemindex
- cxGrid 多选后如何改变数据集的值
- 求高手解决,dbgird中上下行互换后的问题,无法定位行(在线等)
- 请问各位高手,为什么焦点在控件上,而光标不见了,向上面又可以输入内容?
- 关于日期的运算和ADOQUERY
- 如何用动态TQUERY动态生成TDECISION CUBE的字段及TDECISION GRAPH ???
- 异常
- 如何把低版本的程序升级到高版本?
- Quake II已经从被人从C转换到delphi上了,可是我找不到下载,谁英文好帮忙找一下吧。
- 语句错误
- 这是怎么了?
- 想定义一个一维的SafeArray(安全数组),如何建立,如何置数组元素值,求救,100分!
dsInsert : Caption:='Insert'; //把这个分号删除
case1: **;
case2: **;
……
casen: **;
else **
end;