for each xxxx in yyyy

cwbok 2009-06-27 06:40:02
请问 for each xxxx in yyyy 中的xxxx怎么理解
...全文
194 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wang66111988 2009-06-28
  • 打赏
  • 举报
回复
xxxx是变量名,配合foreach用于遍历集合yyyy中的元素
mylove_web 2009-06-27
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 lzp4881 的回复:]
集合中有几个对象值就循环几次,比如
yyyy=array("aaa","bbb","ccc")
for each item in yyyy
response.write item'循环三次,分别输出aaa bbb ccc
next
[/Quote]
很妙!!
如果yyyy是二维的,又如何???
yeyuxuan2006 2009-06-27
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 lzp4881 的回复:]
集合中有几个对象值就循环几次,比如
yyyy=array("aaa","bbb","ccc")
for each item in yyyy
response.write item'循环三次,分别输出aaa bbb ccc
next
[/Quote]

原来如此啊。编程多年了,还一直没用这个呢。





--------------------------------------------------
www.52e3.com (“我爱衣裳” 域名转让)
yang677888 2009-06-27
  • 打赏
  • 举报
回复
[Quote=引用楼主 cwbok 的帖子:]
请问 for each xxxx in yyyy 中的xxxx怎么理解
[/Quote]

yyyy是集合,xxxx是定义好的一个变量,用于遍历集合yyyy中的元素
lzp4881 2009-06-27
  • 打赏
  • 举报
回复
集合中有几个对象值就循环几次,比如
yyyy=array("aaa","bbb","ccc")
for each item in yyyy
response.write item'循环三次,分别输出aaa bbb ccc
next
cwbok 2009-06-27
  • 打赏
  • 举报
回复
如果 不是按次数,这个XXXX的出现有什么意义呢
cwbok 2009-06-27
  • 打赏
  • 举报
回复
是循环几次呢,从XXXX在数组中的位置开始吗。
lzp4881 2009-06-27
  • 打赏
  • 举报
回复
yyyy是集合,xxxx就是集合中的对象
利用ForEach...In 这种循环结构的好处是可以让我们以单一的变量名称,就可以得到所有在集合中的对象
README.TXT NOTES ON MS-DOS VERSION 5.0 =========================== In this file the following topics are covered: 1. Introduction 2. Solving Setup Problems 2.1 Priam and Everex Hard Disks 2.2 SyQuest Removable Hard Disk 2.3 Bernoulli Drive 2.4 Disk Manager 2.5 SpeedStor and Volume Expansion 2.6 Novell Partitions 2.7 Vfeature Deluxe 2.8 Columbia Data Systems Device Driver 2.9 Incompatible Partition 2.10 WYSE Partitions 2.11 286 Accelerator Cards 2.12 Bernoulli Cache 2.13 AT&T 6300 Computers 2.14 LANtastic 2.15 Western Digital SCSI Hard-Disk Controllers 2.16 Change CONFIG.SYS File 2.17 Toshiba T1600 and a Hard RAM Disk 3. Installing MS-DOS 5.0 on OS/2 Systems 3.1 Installing MS-DOS 5.0 and OS/2 Dual-Boot Systems 3.2 Using the Uninstall Program on an OS/2 System 4. Solving Memory Problems 4.1 386MAX 4.2 All Computers Expanded-Memory Driver 4.3 Bus Master DMA Controller 4.4 HIMEM.SYS Location 4.5 INT15 Access to Extended Memory 4.6 Intel LIM Driver 4.7 Phoenix BIOS and HIMEM.SYS 4.8 QEMM 4.9 XMAEM.SYS and XMA2EM.SYS 5. Solving Problems with Windows 5.1 DOS Applications in Windows Enhanced Mode 5.2 EMM386.EXE Location 5.3 WINA20.386 File 5.4 Windows 3.0 Enhanced Debug Version 5.5 Windows 2.03 5.6 Windows/286 2.1 5.7 Windows 386 and the Upper Memory Area 6. Making Your Hardware Compatible with MS-DOS 5.0 6.1 101-key Keyboards and QBasic/MS-DOS Editor 6.2 Acer 1100/33 6.3 Adaptec Controller Boards 6.4 Amstrad Systems and KEYB.COM 6.5 Hardcard II 6.6 COMPAQ EXTDISK.SYS Driver 6.7 Corel System Drivers 6.8 External Disk Drives 6.9 Mice and MS-DOS Shell 6.10 NCR VGA BIOS 6.11 Olivetti Systems 6.12 Toshiba T3100SX 6.13 Western Digital VGA Card 6.14 Zenith Computers 7. Making Your Network Compatible with MS-DOS 5.0 7.1 3+Share 7.2 AT&T StarGROUP 7.3 DCA 10Net and Word5 7.4 DOS LAN Requester 7.5 I

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧