compiler-errors - symbol expected in first line of libre office type definition
问题描述
Talk about a newbie! I can't get my first line to compile. Basic syntax error: Symbol expected
REM ***** BASIC *****
Type xyz
Dim sheet as object
Dim cell as object
dim range as object
End Type
Sub Main
End Sub
Version: 6.0.2.1 (x64) Build ID: f7f06a8f319e4b62f9bc5095aa112a65d2f3ac89
tools->macros->edit macros>
compile
解决方案
Dim declares local variables within subroutines. Type statements do not use it.
The reason this error was tricky to diagnose is that it looks like the problem is in Type xyz
, but that part is fine. The IDE highlights whatever is before the first Dim
statement, which may be a minor problem of the parser. The following code shows that even a comment can get highlighted!
Type xyz
'This comment will be highlighted because of the Dim error.
Dim sheet as object
End Type
This inaccuracy is not unusual for any compiler. Error messages often give clues to problems rather than telling exactly what and where the problem is.
推荐阅读
- docker-compose - jhipster-registry容器启动过程中出现“Your JWT secret key is not set, you will not be able to log into the JHipster”的解决方法
- java - 如何创建搜索嵌入值的存储库方法?
- machine-learning - 初始 kmeans 点如何在 BigQuery ML 中起作用?
- c# - 当用户选择上下文菜单项时,使上下文菜单忽略右键单击
- python - 如何修复我的代码 - KeyError 但我的代码以前可以工作?
- sql - 如果它是唯一的,则在相关表中选择值,如果它不是 oracle,则选择空值
- java - vlcj 视频不显示,可以听到音频。Java-Swing vlcj
- mysql - Ansible mysql 在重启服务时崩溃并损坏
- xamarin.forms - 在 XAML 中绑定到绑定定位器不起作用
- python - 如何在多个字符串上使用通配符或正则表达式