/*:VRX Main */ /* Main */ Main: /* Process the arguments. Get the parent window. */ parse source . calledAs . parent = "" argCount = arg() argOff = 0 if( calledAs \= "COMMAND" )then do if argCount >= 1 then do parent = arg(1) argCount = argCount - 1 argOff = 1 end end; else do call VROptions 'ImplicitNames' call VROptions 'NoEchoQuit' end InitArgs.0 = argCount if( argCount > 0 )then do i = 1 to argCount InitArgs.i = arg( i + argOff ) end drop calledAs argCount argOff /* Load the windows */ call VRInit parse source . . spec _VREPrimaryWindowPath = , VRParseFileName( spec, "dpn" ) || ".VRW" _VREPrimaryWindow = , VRLoad( parent, _VREPrimaryWindowPath ) drop parent spec if( _VREPrimaryWindow == "" )then do call VRMessage "", "Cannot load window:" VRError(), , "Error!" _VREReturnValue = 32000 signal _VRELeaveMain end /* Process events */ call Init signal on halt do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) ) _VREEvent = VREvent() interpret _VREEvent end _VREHalt: _VREReturnValue = Fini() call VRDestroy _VREPrimaryWindow _VRELeaveMain: call VRFini exit _VREReturnValue VRLoadSecondary: __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 ) if __vrlsWait then do call VRFlush end __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) ) if __vrlsHWnd = '' then signal __vrlsDone if __vrlsWait \= 1 then signal __vrlsDone call VRSet __vrlsHWnd, 'WindowMode', 'Modal' __vrlsTmp = __vrlsWindows.0 if( DataType(__vrlsTmp) \= 'NUM' ) then do __vrlsTmp = 1 end else do __vrlsTmp = __vrlsTmp + 1 end __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd ) __vrlsWindows.0 = __vrlsTmp do while( VRIsValidObject( VRWindow() ) = 1 ) __vrlsEvent = VREvent() interpret __vrlsEvent end __vrlsTmp = __vrlsWindows.0 __vrlsWindows.0 = __vrlsTmp - 1 call VRWindow __vrlsWindows.__vrlsTmp __vrlsHWnd = '' __vrlsDone: return __vrlsHWnd /*:VRX __StringTokenize */ __StringTokenize: PROCEDURE EXPOSE (__stem) PARSE ARG string, separator, tokens /* Note: this differs slightly from my usual implementation in that * each token is STRIPped of leading and trailing spaces. */ IF ( string = '') THEN RETURN string IF ( separator = '') THEN separator = ' ' i = 0 CALL VALUE tokens || '0', i DO WHILE LENGTH( string ) > 0 x = 1 y = POS( separator, string, x ) IF y > 0 THEN DO current = SUBSTR( string, 1, y-1 ) x = y + 1 i = i + 1 CALL VALUE tokens || 'i', STRIP( current ) END ELSE DO current = STRIP( string, 'B', separator ) i = i + 1 CALL VALUE tokens || 'i', STRIP( current ) x = LENGTH( string ) + 1 END string = SUBSTR( string, x ) END CALL VALUE tokens || '0', i RETURN /*:VRX CheckForProgram */ /* Checks to see if the specified program executable is installed on the system */ CheckForProgram: PROCEDURE ARG program found = 0 current = DIRECTORY() IF SysSearchPath( current, program ) \= '' THEN found = 1 ELSE IF SysSearchPath('PATH', program ) \= '' THEN found = 1 RETURN found /*:VRX ClearContainer */ ClearContainer: PROCEDURE ok = VRMethod("CN_MAIN", "RemoveRecord", "ALL") ok = VRSet("CN_MAIN", "Caption", "") RETURN /*:VRX CN_MAIN_Click */ CN_MAIN_Click: ok = VRMethod("CN_MAIN", "GetRecordList", Selected, "selected.") IF ( ok = 1 ) & ( selected.0 > 0 ) THEN DO objID = VRMethod( "CN_MAIN", "GetFieldData", selected.1, oidField ) ok = VRSet("WN_MAIN", "HintText", objID ) END CALL VRMethod "WN_MAIN", "Activate" RETURN /*:VRX CN_MAIN_ContextMenu */ CN_MAIN_ContextMenu: _record = VRInfo('record') IF _record == '' THEN RETURN CALL VRMethod 'MN_SELECTED', 'Popup' RETURN /*:VRX CN_MAIN_DoubleClick */ CN_MAIN_DoubleClick: record = VRInfo("Record") IF record \= "" THEN window = VRLoadSecondary("DLG_DETAILS", "W") RETURN /*:VRX CN_MAIN_DragDrop */ CN_MAIN_DragDrop: object = VRInfo("SourceFile") CALL ParseFolder object RETURN /*:VRX DLG_ABOUT_Close */ DLG_ABOUT_Close: call DLG_ABOUT_Fini return /*:VRX DLG_ABOUT_Create */ DLG_ABOUT_Create: call DLG_ABOUT_Init return /*:VRX DLG_ABOUT_Fini */ DLG_ABOUT_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX DLG_ABOUT_Init */ DLG_ABOUT_Init: window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end drop window return /*:VRX DLG_DETAILS_Close */ DLG_DETAILS_Close: call DLG_DETAILS_Fini return /*:VRX DLG_DETAILS_Create */ DLG_DETAILS_Create: call DLG_DETAILS_Init return /*:VRX DLG_DETAILS_Fini */ DLG_DETAILS_Fini: IF ifile <> '' THEN CALL VRDeleteFile ifile window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX DLG_DETAILS_Init */ DLG_DETAILS_Init: title = VRMethod( "CN_MAIN", "GetFieldData", record, nameField ) objID = VRMethod( "CN_MAIN", "GetFieldData", record, oidField ) class = VRMethod( "CN_MAIN", "GetFieldData", record, classField ) setup = VRMethod( "CN_MAIN", "GetFieldData", record, setupField ) type = VRMethod( "CN_MAIN", "GetFieldData", record, typeField ) loc = VRMethod( "CN_MAIN", "GetFieldData", record, locField ) fspec = VRMethod( "CN_MAIN", "GetRecordAttr", record, "Filename" ) IF LEFT( objID, 1 ) = '#' THEN idType = 'Object handle' ELSE IF FILESPEC('DRIVE', objID ) \= '' THEN idType = 'Physical name' ELSE idType = 'Object ID' CALL VRSet "DLG_DETAILS", "Caption", title ' ['type' object]' CALL VRSet "EF_NAME", "Value", title CALL VRSet "DT_ID", "Caption", idType':' CALL VRSet "EF_ID", "Value", objID CALL VRSet "DT_CLASS", "Caption", class CALL VRSet "EF_PARENT", "Value", loc CALL StringTokenize setup, ';', 'tokens.' CALL VRMethod "LB_SETUP", "AddStringList", "tokens." export_dir = '' IF idType == 'Physical name' THEN CALL VRSet 'PICT_ICON', 'PicturePath', fspec ELSE DO ifile = GetObjectIcon( objID ) IF ifile <> '' THEN DO CALL VRSet 'PICT_ICON', 'PicturePath', ifile CALL VRMethod "CN_MAIN", "SetRecordAttr", record, "Icon", ifile END END window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end DROP window RETURN /*:VRX DLG_PROGRESS_Close */ DLG_PROGRESS_Close: call DLG_PROGRESS_Fini return /*:VRX DLG_PROGRESS_Create */ DLG_PROGRESS_Create: call DLG_PROGRESS_Init return /*:VRX DLG_PROGRESS_Fini */ DLG_PROGRESS_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX DLG_PROGRESS_Init */ DLG_PROGRESS_Init: INTERPRET 'CALL Export'export_type CALL DLG_PROGRESS_Fini RETURN /*:VRX ExportFI */ ExportFI: ok = VRMethod("CN_MAIN", "GetRecordList", "All", "allRecords.") IF ( ok \= 1 ) | ( allRecords.0 < 1 ) THEN RETURN /* Should ask the user for these, eventually */ action = 'UPDATE' pkgid = 'OBJECTS' rspFile = VRFileDialog( VRWindow(), "Save As File", "S", "OBJECTS.RSP") IF rspFile = '' THEN RETURN ok = STREAM( rspFile, 'C', 'OPEN WRITE') IF ok \= 'READY:' THEN DO CALL VRMessage VRWindow(), ok, "Error opening file", "E" RETURN END IF STREAM( rspFile, 'C', 'QUERY EXISTS') \= '' THEN CALL SysFileDelete rspFile CALL LINEOUT rspFile, pkgid"=(" DO i = 1 TO allRecords.0 record = allRecords.i title = VRMethod("CN_MAIN", "GetFieldData", record, nameField ) class = VRMethod("CN_MAIN", "GetFieldData", record, classField ) setup = VRMethod("CN_MAIN", "GetFieldData", record, setupField ) location = VRMethod("CN_MAIN", "GetFieldData", record, locField ) /* Need to replace all ';' in setup with '^;' */ /* string = setup DO FOREVER ipos = pos(';', string ) IF ( ipos = 0 ) THEN LEAVE IF ( ipos = 1 ) THEN string = '^;' || SUBSTR( string, 2 ) ELSE string = SUBSTR( string, 1, ipos - 1 ) || '^;' || SUBSTR( string, ipos + 1 ) END setup = string */ CALL LINEOUT rspFile, ' ObjectCreation=(' CALL LINEOUT rspFile, ' ClassName='class CALL LINEOUT rspFile, ' ObjectTitle[0]='title CALL LINEOUT rspFile, ' SetupString='setup CALL LINEOUT rspFile, ' Location='location CALL LINEOUT rspFile, ' Flags='3 CALL LINEOUT rspFile, ' )' END CALL LINEOUT rspFile, ')' CALL STREAM rspFile, 'C', 'CLOSE' CALL VRMessage VRWindow(), "Data saved to" rspFile, "Done", "I" RETURN /*:VRX ExportIniRc */ ExportIniRc: ok = VRMethod("CN_MAIN", "GetRecordList", "All", "allRecords.") IF ( ok \= 1 ) | ( allRecords.0 < 1 ) THEN RETURN /* Should ask the user for these, eventually */ cp = '850' action = 'UPDATE' rcFile = VRFileDialog( VRWindow(), "Save As File", "S", "OBJECTS.RC") IF rcFile = '' THEN RETURN ok = STREAM( rcFile, 'C', 'OPEN WRITE') IF ok \= 'READY:' THEN DO CALL VRMessage VRWindow(), ok, "Error opening file", "E" RETURN END CALL LINEOUT rcFile, 'CODEPAGE' cp CALL LINEOUT rcFile, 'STRINGTABLE' CALL LINEOUT rcFile, 'BEGIN' CALL LINEOUT rcFile, '' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, ' ""' CALL LINEOUT rcFile, '' DO i = 1 to allRecords.0 record = allRecords.i title = VRMethod("CN_MAIN", "GetFieldData", record, nameField ) class = VRMethod("CN_MAIN", "GetFieldData", record, classField ) setup = VRMethod("CN_MAIN", "GetFieldData", record, setupField ) location = VRMethod("CN_MAIN", "GetFieldData", record, locField ) CALL LINEOUT rcFile, ' "PM_InstallObject" "'title';'class';'location';'action'" "'setup'"' END DROP allRecords. CALL LINEOUT rcFile, '' CALL LINEOUT rcFile, ' "" "" ""' CALL LINEOUT rcFile, 'END' CALL STREAM rcFile, 'C', 'CLOSE' CALL VRMessage VRWindow(), "Data saved to" rcFile, "Done", "I" RETURN /*:VRX ExportREXX */ ExportREXX: cmdFile = VRFileDialog( VRWindow(), "Save As File", "S", "OBJECTS.CMD") IF cmdFile = '' THEN RETURN window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end drop window ok = VRMethod("CN_MAIN", "GetRecordList", "All", "allRecords.") IF ( ok \= 1 ) | ( allRecords.0 < 1 ) THEN RETURN /* Should ask the user for these, eventually */ action = 'UPDATE' export_dir = VRParseFileName( cmdFile, 'DP') ok = STREAM( cmdFile, 'C', 'OPEN WRITE') IF ok \= 'READY:' THEN DO CALL VRMessage VRWindow(), ok, "Error opening file", "E" RETURN END CALL VRSet 'WN_MAIN', 'Pointer', 'Wait' CALL VRSet 'DT_PROGRESS1', 'Caption', 'Generating REXX script:' VRParseFilePath( cmdFile, 'NE') CALL LINEOUT cmdFile, '/* OBJECTS.CMD */' CALL LINEOUT cmdFile, 'CALL RxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs"' CALL LINEOUT cmdFile, 'CALL SysLoadFuncs' CALL LINEOUT cmdFile, '' CALL LINEOUT cmdFile, 'SAY "Creating objects:"' CALL LINEOUT cmdFile, '' DO i = 1 to allRecords.0 record = allRecords.i title = VRMethod("CN_MAIN", "GetFieldData", record, nameField ) class = VRMethod("CN_MAIN", "GetFieldData", record, classField ) setup = VRMethod("CN_MAIN", "GetFieldData", record, setupField ) location = VRMethod("CN_MAIN", "GetFieldData", record, locField ) objID = VRMethod("CN_MAIN", "GetFieldData", record, oidField ) fspec = VRMethod("CN_MAIN", "GetRecordAttr", record, "Filename") CALL VRSet 'DT_PROGRESS2', 'Caption', title '('class')' CALL LINEOUT cmdFile, 'IF SysCreateObject("'class'", "'StuffQuotes( title )'",,' CALL LINEOUT cmdFile, ' "'StuffQuotes( location )'",,' /* Sanitize the object setup string. */ CALL StringTokenize setup, ';', 'tokens.' setup_string = '' DO j = 1 TO tokens.0 PARSE UPPER VAR tokens.j _key '=' _value IF _key == 'TITLE' THEN ITERATE IF _value == 'DEFAULT' THEN ITERATE IF (class == 'WPProgram' | class == 'WPFolder') & tokens.j == 'NOPRINT=YES' THEN ITERATE new_piece = StuffQuotes( tokens.j ) IF ( LENGTH( setup_string ) + LENGTH( new_piece )) > 240 THEN DO CALL LINEOUT cmdFile, ' "'setup_string'" ||,' setup_string = '' END setup_string = setup_string || new_piece || ';' END /* Try to preserve any custom icon (non-filesystem objects only). */ IF ( class == 'WPFolder') | ( class == 'WPDataFile') THEN icon_file = '' ELSE icon_file = GetObjectIcon( objID ) IF icon_file <> '' THEN DO /* Doesn't apply to folders, so no need to handle animation icon */ new_piece = 'ICONFILE='icon_file IF ( LENGTH( setup_string ) + LENGTH( new_piece )) > 240 THEN DO CALL LINEOUT cmdFile, ' "'setup_string'" ||,' setup_string = '' END setup_string = setup_string || new_piece || ';' END CALL LINEOUT cmdFile, ' "'setup_string'",,' CALL LINEOUT cmdFile, ' "'action'") == 1 THEN' CALL LINEOUT cmdFile, ' SAY " ' || LEFT( title, 73 ) || '[OK]"' percent = ( i * 100 ) % allRecords.0 CALL VRSet 'PRO_PROGRESS', 'Percent', percent END DROP allRecords. CALL LINEOUT cmdFile, '' CALL LINEOUT cmdFile, 'RETURN' CALL STREAM cmdFile, 'C', 'CLOSE' CALL VRSet 'WN_MAIN', 'Pointer', '' CALL VRMessage VRWindow(), "Data saved to" cmdFile, "Done", "I" RETURN /*:VRX Fini */ Fini: window = VRWindow() call VRSet window, "Visible", 0 drop window return 0 /*:VRX GetObjectIcon */ GetObjectIcon: PROCEDURE EXPOSE has_oo export_dir PARSE ARG objID IF LEFT( objID, 1 ) = '#' THEN DO PARSE VAR objID '#' habstract habstract = STRIP( habstract, 'L', '0') END ELSE DO IF has_oo == 0 THEN RETURN '' nq = RXQUEUE('Create') oq = RXQUEUE('Set', nq ) ADDRESS CMD '@oo.exe /ih "'objID'" 2>&1|RXQUEUE' nq IF QUEUED() THEN DO PARSE PULL line habstract = line END ELSE habstract = '' CALL RXQUEUE 'Set', oq CALL RXQUEUE 'Delete', nq END IF habstract == '' THEN RETURN '' PARSE VAR habstract '2' ini_key . IF ini_key == '' THEN DO RETURN '' END idata = VRGetIni('PM_Abstract:Icons', ini_key, 'User') IF idata == '' THEN DO RETURN '' END IF export_dir == '' THEN export_dir = VALUE('TMP',,'OS2ENVIRONMENT') ifile = export_dir'\'habstract'.ICO' CALL STREAM ifile, 'C', 'OPEN WRITE' CALL CHAROUT ifile, idata CALL STREAM iFile, 'C', 'CLOSE' RETURN ifile /*:VRX Halt */ Halt: signal _VREHalt return /*:VRX Init */ Init: CALL RxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs" CALL SysLoadFuncs CALL RxFuncAdd 'WPToolsLoadFuncs', 'WPTOOLS', 'WPToolsLoadFuncs' CALL WPToolsLoadFuncs has_oo = CheckForProgram('OO.EXE') CALL InitContainer window = VRWindow() call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" drop window return /*:VRX InitContainer */ InitContainer: nameField = VRMethod("CN_MAIN", "AddField", "String", "Name") classField = VRMethod("CN_MAIN", "AddField", "String", "Class") setupField = VRMethod("CN_MAIN", "AddField", "String", "Setup") locField = VRMethod("CN_MAIN", "AddField", "String", "Location") oidField = VRMethod("CN_MAIN", "AddField", "String", "Object-ID") typeField = VRMethod("CN_MAIN", "AddField", "String", "Type") CALL VRMethod "CN_MAIN", "SetFieldAttr", oidField, "Visible", 0 CALL VRMethod "CN_MAIN", "SetFieldAttr", typeField, "Visible", 0 RETURN /*:VRX MI_ABOUT_Click */ MI_ABOUT_Click: PROCEDURE window = VRLoadSecondary("DLG_ABOUT", "W") RETURN /*:VRX MI_CLEAR_Click */ MI_CLEAR_Click: PROCEDURE CALL ClearContainer RETURN /*:VRX MI_DELETE_Click */ MI_DELETE_Click: records.0 = 0 CALL VRMethod 'CN_MAIN', 'GetRecordList', 'Selected', 'records.' IF records.0 > 0 THEN CALL VRMethod 'CN_MAIN', 'RemoveRecord', records.1 RETURN /*:VRX MI_DETAILS_Click */ MI_DETAILS_Click: IF VRGet("CN_MAIN", "View") = "IconTree" THEN DO CALL VRSet "CN_MAIN", "View", "Detail" CALL VRSet "MI_TREE", "Checked", 0 CALL VRSet "MI_DETAILS", "Checked", 1 END RETURN /*:VRX MI_EXIT_Click */ MI_EXIT_Click: CALL Quit return /*:VRX MI_FIRSP_Click */ MI_FIRSP_Click: CALL ExportFI RETURN /*:VRX MI_INIRC_Click */ MI_INIRC_Click: CALL ExportIniRc return /*:VRX MI_OBJECT_Click */ MI_OBJECT_Click: records.0 = 0 CALL VRMethod 'CN_MAIN', 'GetRecordList', 'Selected', 'records.' IF records.0 > 0 THEN DO record = records.1 window = VRLoadSecondary("DLG_DETAILS", "W") END RETURN /*:VRX MI_REXX_Click */ MI_REXX_Click: export_type = 'REXX' CALL VRLoadSecondary 'DLG_PROGRESS', 'W' RETURN /*:VRX MI_TREE_Click */ MI_TREE_Click: IF VRGet("CN_MAIN", "View") = "Detail" THEN DO CALL VRSet "CN_MAIN", "View", "IconTree" CALL VRSet "MI_DETAILS", "Checked", 0 CALL VRSet "MI_TREE", "Checked", 1 END RETURN /*:VRX ParseFolder */ ParseFolder: PROCEDURE EXPOSE nameField classField setupField locField oidField typeField PARSE ARG folder, parent ok = WPToolsQueryObject( folder, "szClass", "szTitle", "szSetupString", "szLocation") IF ok = 0 THEN RETURN IF szTitle = "" THEN szTitle = folder PARSE VAR szSetupString . 'OBJECTID='oid';' . IF oid = "" THEN oid = folder topHandle = VRMethod("CN_MAIN", "AddRecord", parent, "Last", szTitle, "#10") ok = VRMethod("CN_MAIN", "SetRecordAttr", topHandle, "Filename", VRExpandFileName( folder )) ok = VRMethod("CN_MAIN", "SetFieldData", topHandle, nameField, szTitle, classField, szClass, setupField, szSetupString, locField, szLocation, oidField, oid, typeField, 'filesystem') /* Get the file system objects */ IF FILESPEC('DRIVE', folder ) \= '' THEN DO IF szClass \= "WPNetgrp" THEN DO ok = SysFileTree( folder'\*', 'subdirs.', 'DO') IF ok \= 0 THEN RETURN DO i = 1 TO subdirs.0 CALL ParseFolder subdirs.i, topHandle END END ok = SysFileTree( folder'\*', 'files.', 'FO') IF ok \= 0 THEN RETURN DO i = 1 TO files.0 fsName = FILESPEC('NAME', files.i ) szClass = '' szTitle = '' szSetupString = '' szLocation = '' ok = WPToolsQueryObject( files.i, "szClass", "szTitle", "szSetupString", "szLocation") PARSE VAR szSetupString . 'OBJECTID='id';' . IF id = '' THEN id = files.i IF szTitle = '' THEN szTitle = fsName recordHandle = VRMethod("CN_MAIN", "AddRecord", topHandle, "Last", szTitle, "#10") ok = VRMethod("CN_MAIN", "SetRecordAttr", recordHandle, "Filename", files.i ) ok = VRMethod("CN_MAIN", "SetFieldData", recordHandle, nameField, szTitle, classField, szClass, setupField, szSetupString, locField, szLocation, oidField, id, typeField, 'filesystem') END END /* Get the abstract objects */ ok = WPToolsFolderContent( folder, "contents.") IF ok = 0 THEN RETURN DO i = 1 TO contents.0 szClass = '' szTitle = '' szSetupString = '' szLocation = '' ok = WPToolsQueryObject( contents.i, "szClass", "szTitle", "szSetupString", "szLocation") IF ok = 0 THEN LEAVE IF szTitle = "" THEN szTitle = contents.i recordHandle = VRMethod("CN_MAIN", "AddRecord", topHandle, "Last", szTitle, "#10") ok = VRMethod("CN_MAIN", "SetFieldData", recordHandle, nameField, szTitle, classField, szClass, setupField, szSetupString, locField, szLocation, oidField, contents.i, typeField, 'abstract') END CALL VRSet "CN_MAIN", "Caption", folder RETURN /*:VRX PB_ABOUTOK_Click */ PB_ABOUTOK_Click: CALL DLG_ABOUT_Close return /*:VRX PB_DETAILSCLOSE_Click */ PB_DETAILSCLOSE_Click: CALL DLG_DETAILS_Close return /*:VRX PICT_ICON_DragDrop */ PICT_ICON_DragDrop: iconspec = VRInfo('SourceFile') IF iconspec == '' THEN RETURN CALL VRSet 'PICT_ICON', 'UserData', iconspec CALL VRSet 'PICT_ICON', 'PicturePath', iconspec RETURN /*:VRX Quit */ Quit: window = VRWindow() call VRSet window, "Shutdown", 1 drop window return /*:VRX StringTokenize */ StringTokenize: PARSE ARG string, separator, __stem CALL __StringTokenize string, separator, __stem DROP __stem RETURN /*:VRX StuffQuotes */ StuffQuotes: PROCEDURE /* Replace any instance of " in target with "". */ PARSE ARG target stuffedname = '' dblquote = POS('"', target ) DO WHILE dblquote > 0 PARSE VAR target _before'"'target stuffedname = stuffedname || _before'""' dblquote = POS('"', target ) END stuffedname = stuffedname || target RETURN stuffedname /*:VRX WN_MAIN_Close */ WN_MAIN_Close: call Quit return