四季豆又要学习啦!!!
1、等号 :=
2、不等号 #
3、注释符号 *
4、字符串赋值 str:=’halcon’
5、等于比较符号 if(x=10)
6、与运算 if(A>1 and A<30)
7、或运算 if(A>1 or A<30)
8、求反 if(not(A=10))
9、for循环 for I := 0 to NumBalls - 1 by 1
、、、、、(操作代码)
endfor
这是以for循环批量加载图片的例子(test是存放图片的文件夹)
list_files ('F:/test', ['files','follow_links'], ImageFiles)
tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$','ignore_case'], ImageFiles)
for Index := 0 to |ImageFiles| - 1 by 1
read_image (Image, ImageFiles[Index])
* Image Acquisition 01: Do something
endfor
10、While 循环
while (x== 1)
Endwhile
11、异常获取:
Try
catch (Exception)
Endtry
12、Switch多分支:
switch (Index)
case 1:
break
case 2:
break
case 3:
break
default:
break
endswitch
暂时没了,放戳怡情