Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在执行 Qt 脚本时使用其中的对象和函数来获取当前行号?
var lineNumber = 1; try { unexsistedVariable1 + unexsistedVariable2; //we have got number of this line } catch(e) { lineNumber = e.lineNumber; }
使用__LINE__int 常量,编译代码时会填充该常量。
__LINE__