地理信息系统知识库gisbase

http://www.cnblogs.com/gisbase
  新随笔  :: 联系 :: 订阅 订阅  :: 管理

AML 文件读取

Posted on 2010-01-30 18:38  gisbase  阅读(1105)  评论(2编辑  收藏  举报

/* Get file from user and open the file.

&setvar fil := [response 'Enter file name to read']

&if [null %fil%] &then

  &return &warning No file entered.

&setvar filunit := [open %fil% openstatus -read]

 

/* Check for error in opening file.

&if %openstatus% <> 0 &then

  &return &warning Error opening file.

 

/* Read from file

&setvar line := [read %filunit% readstatus]

&if %readstatus% <> 0 &then

  &return &warning Could not read file.

&do &while %readstatus% = 0

  &type %line%

  /* Read next line.

  &setvar line := [read %filunit% readstatus]

&end

 

/* Close file.

&if [close %filunit%] <> 0 &then

  &return &warning Unable to close %fil%.

&return End of file.