【零基础学习CAPL语法】——writeLineEx() 函数
🙋♂️【零基础学习CAPL】系列💁♂️点击跳转
文章目录
- 1.函数介绍
- 2.实例
1.函数介绍
void writeLineEx(long sink, dword severity, char format[], …)
用于向指定窗口 带换行 地输出一条格式化字符串,并可同时指定消息类型(Info/Warning/Error/Success)。
它是调试、记录和报错时最常用的函数之一。
sink(输出目标)用于指定信息输出到哪个窗口或设备,常用取值:
-3:Trace Window
0:Output to the System page of the Write Window
1:Output to the CAPL page of the Write Window
4:Output to the Test page of the Write Window
severity(信息级别)
用于分类信息:
0:Success 普通信息
1:Information 警告
2:Warning错误
3:Error致命错误
2.实例
writeLineEx(-3,1,"-3 :在CAPL窗口输出");
writeLineEx(0,1,"0 :Write窗口输出");
writeLineEx(1,1,"1 :Write窗口输出");
writeLineEx(4,1,"4 :Write窗口输出");
writeLineEx(4,1,"1:Information 警告");
writeLineEx(4,2,"2:Warning错误");
writeLineEx(4,3,"3:Error致命错误");