OV_QUERY_SYS_INFO

Query system configuration information.

Note: The user of this Built-In Function is responsible for any impact it has on any application. No warranty of any kind is expressed or implied. Refer to full Disclaimer.

Function No:

993

DLL Required:

U_BIF993.DLL

For use with

Visual LANSA for Windows

YES

Visual LANSA for Linux

NO

LANSA for i

NO

 

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Information to be queried

Pass as one of :

SYS_DRIV

SYS_DIR

SYS_DIR_EXECUTE

SYS_DIR_SOURCE

SYS_DIR_OBJECT

PART_DRIV

PART_DIR

PART_DIR_EXECUTE

PART_DIR_SOURCE

PART_DIR_OBJECT

TEMP_DRIV

TEMP_DIR

DRIV_LIST

 

1

256

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Information returned.

SYS_DRIV  Returns the drive in which the LANSA system is located as a drive letter followed by a colon. e.g: C: or D: or E:

SYS_DIR  Returns the root directory in which the LANSA system is located. e.g: D:\X_WIN95\X_LANSA\

SYS_DIR_EXECUTE  Returns the directory in which the LANSA system EXECUTE objects are located. e.g: D:\X_WIN95\X_LANSA\EXECUTE\

SYS_DIR_SOURCE  Returns the directory in which the LANSA system SOURCE objects are located. e.g: D:\X_WIN95\X_LANSA\SOURCE\

SYS_DIR_OBJECT  Returns the directory in which the LANSA system OBJECT objects are located. e.g: D:\X_WIN95\X_LANSA\OBJECT\

PART_DRIV  Returns the drive in which the current partitions LANSA system is located as a drive letter followed by a colon. e.g: C: or D: or E:

PART_DIR  Returns the root directory in which the current partitions system is located. e.g.: D:\X_WIN95\X_LANSA\X_DEM\

PART_DIR_EXECUTE  Returns the directory in which the current partitions EXECUTE objects are located. e.g: D:\X_WIN95\X_LANSA\X_DEM\EXECUTE\

PART_DIR_SOURCE  Returns the directory in which the current partitions SOURCE objects are located. e.g: D:\X_WIN95\X_LANSA\X_DEM\SOURCE\

PART_DIR_OBJECT  Returns the directory in which the current partitions OBJECT objects are located. e.g: D:\X_WIN95\X_LANSA\X_DEM\OBJECT\

TEMP_DRIV  Returns the drive in which temporary files / objects should be created as a drive letter followed by a colon. e.g: C: or D: or E:

TEMP_DIR  Returns the directory in which temporary files/objects should be created. e.g: D:\TEMP\

DRIV_LIST  Returns a working list in return value 2. This value (return value 1) must be passed as a dummy argument when making a DRIV_LIST request.

1

256

 

 

2

List

Opt

Working list to contained returned information. Currently only required for a DRIV_LIST request. Refer to the following examples for the layout and format of the returned working list for DRIV_LIST requests.

N/A

 

 

 

 

Examples

The following sample RDML function (which can be copied and pasted in the CS/400 free form function editor) queries and displays all possible drive/path combinations:

FUNCTION OPTIONS(*DIRECT)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(SYS_DRIV)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(SYS_DIR)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(SYS_DIR_EXECUTE)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(SYS_DIR_OBJECT)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(SYS_DIR_SOURCE)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(PART_DRIV)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(PART_DIR)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(PART_DIR_EXECUTE)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(PART_DIR_OBJECT)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(PART_DIR_SOURCE)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(TEMP_DRIV)
EXECUTE SUBROUTINE(SHOW_INFO) WITH_PARMS(TEMP_DIR)
********** COMMENT(Display subroutine)
SUBROUTINE NAME(SHOW_INFO) PARMS(  OV_QUERY)
DEFINE FIELD(#OV_QUERY) TYPE(*CHAR) LENGTH(50)
DEFINE FIELD(#OV_RESULT) TYPE(*CHAR) LENGTH(50)
USE BUILTIN(OV_QUERY_SYS_INFO) WITH_ARGS(#OV_QUERY) TO_GET(#OV_RESULT)
DISPLAY FIELDS(#OV_QUERY #OV_RESULT)
ENDROUTINE

This sample displays the drive letters and drive types of all disk drives attached to the current PC. Note that the drive type is returned as REM (Removable drive), FIX (Fixed drive), NET (Network drive), CD (CD-ROM drive) or RAM (RAM Drive).

Under Windows 3.1 the available drives are only classified as type REM, FIX or NET.

Under Windows 95/NT the available drives are only classified as type REM, FIX, NET, CD or RAM.

Note also that in this sample the drive letter is returned as a char(2) in format A:, B:, etc :

FUNCTION OPTIONS(*DIRECT)
DEFINE FIELD(#OV_RESULT) TYPE(*CHAR) LENGTH(50)
DEFINE FIELD(#OV_DRIVE) TYPE(*CHAR) LENGTH(2)
DEFINE FIELD(#OV_TYPE) TYPE(*CHAR) LENGTH(3)
DEF_LIST NAME(#OV_DRIVD) FIELDS(#OV_DRIVE #OV_TYPE)
DEF_LIST NAME(#OV_DRIVW) FIELDS(#OV_DRIVE #OV_TYPE) TYPE(*WORKING) ENTRYS(26)
********** COMMENT(Extract list off drives and display)
USE BUILTIN(OV_QUERY_SYS_INFO) WITH_ARGS(DRIV_LIST) TO_GET(#OV_RESULT #OV_DRIVW)
CLR_LIST NAMED(#OV_DRIVD)
SELECTLIST NAMED(#OV_DRIVW)
ADD_ENTRY TO_LIST(#OV_DRIVD)
ENDSELECT
DISPLAY BROWSELIST(#OV_DRIVD)

This sample requests that you specify the drive type you are interested in as REM, FIX, NET or ALL and displays all drives of the requested type in a drop down. Note that in this sample the drive letter is returned as a char(1) in format A, B, C, etc :

FUNCTION OPTIONS(*DIRECT)
DEFINE FIELD(#OV_RESULT) TYPE(*CHAR) LENGTH(50)
DEFINE FIELD(#OV_DRIVE) TYPE(*CHAR) LENGTH(1) INPUT_ATR(DDHD)
DEFINE FIELD(#OV_WDRIVE) TYPE(*CHAR) LENGTH(1)
DEFINE FIELD(#OV_TYPE) TYPE(*CHAR) LENGTH(3)
DEFINE FIELD(#OV_WTYPE) TYPE(*CHAR) LENGTH(3)
DEFINE FIELD(#OV_RC) TYPE(*CHAR) LENGTH(2)
DEFINE FIELD(#OV_WCOUNT) TYPE(*DEC) LENGTH(7) DECIMALS(0) DEFAULT(*zero)
DEF_LIST NAME(#OV_DRIVW) FIELDS(#OV_WDRIVE #OV_WTYPE) TYPE(*WORKING) ENTRYS(26)
DEF_COND NAME(*SHOWDRIV) COND('#OV_wcount *gt 0')
********** COMMENT(Request type to be shown in Drop Down)
BEGIN_LOOP
REQUEST FIELDS(#OV_TYPE (#OV_DRIVE *SHOWDRIV))
BEGINCHECK
VALUECHECK FIELD(#OV_TYPE) WITH_LIST('REM' 'FIX' 'NET' 'ALL') MSGTXT('Type must be REM, FIX, NET or ALL')
ENDCHECK
********** COMMENT(Extract list off drives and display)
USE BUILTIN(OV_QUERY_SYS_INFO) WITH_ARGS(DRIV_LIST) TO_GET(#OV_RESULT #OV_DRIVW)
USE BUILTIN(DROP_DD_VALUES) WITH_ARGS(DDHD) TO_GET(#OV_RC)
CHANGE FIELD(#OV_WCOUNT #OV_DRIVE) TO(*NULL)
SELECTLIST NAMED(#OV_DRIVW)
IF COND('(#OV_type = #OV_wtype) *or (#OV_type = ALL)')
CHANGE FIELD(#OV_WCOUNT) TO('#OV_wcount + 1')
USE BUILTIN(ADD_DD_VALUES) WITH_ARGS(DDHD *BLANKS #OV_WDRIVE) TO_GET(#OV_RC)
IF_NULL FIELD(#OV_DRIVE)
CHANGE FIELD(#OV_DRIVE) TO(#OV_WDRIVE)
ENDIF
ENDIF
ENDSELECT
IF COND('#OV_wcount <= 0')
MESSAGE MSGTXT('No drives of the requested type exist on (or are accessible to) this system')
ENDIF
END_LOOP