Home | About SQeeL | Document | DownLoad | Mail Japanese
Home > Document > SQeeL Reference
A B C D E F G H I J L M N O P R S T U X Y  

D

  • Built-in variable
  • Built-in function
  • DATE
    Description
    Current Date (MM/DD)
    Read / Write
    r
    Type
    string
    initial value
    undefined
    Topへ
    DBERR
    Description
    Database error code
    Read / Write
    r
    Type
    number
    initial value
    undefined
    Requirements
    dboralib.slb
    Topへ
    DBERRMSG
    Description
    Database error message
    Read / Write
    r
    Type
    string
    initial value
    NULL
    Requirements
    dboralib.slb
    Topへ
    DBUSER
    Description
    Database username
    Read / Write
    r
    Type
    string
    initial value
    NULL
    Requirements
    dboralib.slb
    Topへ
    directory()
    Description
    Pseudo function
    Directory information can be accessed by considering as a virtual table
    File is considered as row, and name, size, data updated, time updated, and attribute of the file are considered as column. Column name is NAME, SIZE, DATE, TIME, and ATTR respectively.
    The DATE is returned as a string with the format YYYYMMDD
    The TIME is returned as a string with the format HHMMSS
    In the ATTR column, it returns the letter 'd' indicating a directory, or returns string with length 0
    Syntax
    ret = directory(dirname)
    Parameters
    dirname:directory path
    Return Value
    0:Success
    10:Argument error
    System Return Value
    ERROR
    0Success
    10Argument error
    Example
    //[result example]
    //
    // c:testdir/. : file size is 0, last modified time is 20031120
    // c:testdir/.. : file size is 0, last modified time is 20031120
    // c:testdir/sample1.txt : file size is 410, last modified time is 20031101
    // c:testdir/sample2.txt : file size is 1230, last modified time is 20031108
    // c:testdir/sample3.txt : file size is 37720, last modified time is 20031115
    //
    
    run()
    exit
    
    function run()
    	local dirname = 'c:testdir'
    	local tab
    	local i
    
    	xsql select NAME, SIZE, DATE from directory('${dirname}', 'NAME', 'SIZE', 'DATE');
    	tab = xfetch(0)
    	xclose()
    
    	loop i=0;i<count(tab); i++
    		print('${dirname}/${tab[i]["NAME"]} : file size is ${tab[i]["SIZE"]}, last modified time is ${tab[i]["DATE"]}', stdout)
    	endloop
    
    endfunction
    
    Topへ

    © Insight Technology, Inc. 1996-2003 All Rights Reserved.