中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-04 06:17
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » [Question] About variable localization!
Printable Version  786 / 3
Floor1 myth126 Posted 2007-04-14 09:14
初级用户 Posts 16 Credits 47
I’ve never really understood what variable localization is! Yet in some friends’ works I often see it appear. I also couldn’t find any materials about it on the forum, so I’d like to ask all the experts: what does variable localization mean, and what is it used for? Is it like the difference between local variables and global variables in high-level languages?

[ Last edited by myth126 on 2007-4-13 at 08:40 PM ]
Floor2 lxmxn Posted 2007-04-14 13:34
版主 Posts 4,938 Credits 11,386
It can be understood as a local variable. When the batch file finishes running, the variable is gone too, and the memory space allocated for it is also released; this is different from system variables (which can be understood as global variables).
Floor3 myth126 Posted 2007-04-16 07:35
初级用户 Posts 16 Credits 47
Thanks for your reply! It’s still not very clear! ^_^ Then are variables that aren’t localized just system variables? Feels a bit confusing! ^_^
Floor4 lxmxn Posted 2007-04-16 11:34
版主 Posts 4,938 Credits 11,386
Variables set in a batch script are generally local, while system variables can be used directly without needing to be set.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023