PROGRAM uai_lgicmd !Module definition ------------------------------------------------------------- !Name: uai_lgicmd.bas !Created: 06-Aug-1991, Mark E. Lasoff, GWA Information Systems, INC, 617/890-1838. !Purpose: Return the LGICMD for a given username. !Modified: 06-Aug-1991, MEL, created. !------------------------------------------------------------------------------- !Notes to compile and link this basic module, and the associated macro routine: !compile: $ basic/nodebug uai_lgicmd ! $ macro/nodebug $uaidef !link: $ link/notraceback uai_lgicmd, $uaidef !run1: $ run uai_lgicmd !run2: $ runuai := $device:[directory]uai_lgicmd ! $ runuai USERNAME ! $ if .not. $status then write sys$output "*ERROR*" !output: $ show symbol uai_lgicmd ! !------------------------------------------------------------------------------- !$uaidef.mar .TITLE $UAIDEF define UAI$ constants ! $UAIDEF GLOBAL ! .END !------------------------------------------------------------------------------- OPTION TYPE = EXPLICIT RECORD item_list3 VARIANT CASE STRING rec = 12 CASE WORD buff_len, item_code LONG buff_addr, rtn_len_addr END VARIANT END RECORD RECORD return_info VARIANT CASE STRING rec = 66 CASE STRING lgicmd_string = 64 WORD lgicmd_length END VARIANT END RECORD DECLARE & LONG junklong, condition, & STRING jpi_username, temp_lgicmd, & item_list3 item(1), & return_info rett DECLARE LONG FUNCTION & gwa_check (LONG) ! BY VALUE) EXTERNAL LONG CONSTANT & Lib$k_cli_global_sym, Lib$k_cli_local_sym, Jpi$_username, & Uai$_lgicmd EXTERNAL SUB & Lib$signal (LONG BY VALUE) EXTERNAL LONG FUNCTION & Sys$getuai, & Lib$set_symbol (STRING, STRING, LONG), & Lib$getjpi (LONG, LONG, STRING, LONG, STRING, WORD), & Lib$get_foreign (STRING) !subroutines DEF LONG gwa_check (LONG local_condition) !This is a local gwa$check.mar routine. IF (NOT local_condition) AND "1"L THEN CALL Lib$signal (local_condition) END IF END DEF !gwa_check !mainline IF (NOT Lib$get_foreign(jpi_username)) AND "1"L THEN EXIT PROGRAM END IF jpi_username = EDIT$(jpi_username, "34"L) !Remove spaces(2), and make uppercase(32), {only needed if you allow user input} IF jpi_username = "" THEN junklong = gwa_check(Lib$getjpi(Jpi$_username,,,, jpi_username, )) !Get current username. END IF rett::rec = "" !Initialize output string. item(0)::buff_len = "64"W !Length of LGICMD. item(0)::item_code = Uai$_lgicmd item(0)::buff_addr = LOC(rett::lgicmd_string) item(0)::rtn_len_addr = LOC(rett::lgicmd_length) item(1)::buff_len = "0"W !Last element in item-list was the previous buffer. item(1)::item_code = "0"W junklong = gwa_check(Sys$getuai(,, jpi_username, item("0"L),,,)) !1st byte of 64 bytes is the length. see doc set p.320. temp_lgicmd = EDIT$(SEG$(rett::lgicmd_string, "2"L, "64"L), "6"L) !2=spaces, 4=escape codes. junklong = gwa_check(Lib$set_symbol("UAI_LGICMD", temp_lgicmd, Lib$k_cli_local_sym)) !normal successful completion. END PROGRAM !uai_lgicmd