☰
BMC PSL function(48)-foreach statement
2026/10/22 6:52:58 网站建设 项目流程

foreach

含义:Iterates over a list and sets variable to be each element of list, performing BLOCK for
each element of list.白话文:对变量list中的所有“行”进行逐行扫描,直到全部行扫描完并执行BLOCK结束为止

Format

foreach variable (list) {BLOCK}

foreach unit [arg] variable (list) {BLOCK}

Parameters

Parameter

Definition

unit

controls how list is split into individual elements

Valid Values
->word assumes that the array elements are separated by white space (spaces, tabs, or \n)
->line assumes that array elements are separated by \n
-> __single (preceded by double underscore) matches each individual occurrence of any separators from the speci

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询