Site Index - Feedback - Impressum |
| |||||||||
|
|
( Archiv ) | ( Neues Thema ) |
( Zeige die Threadübersicht ) | ( Zur Startübersicht ) |
28.07.2000 |
Objektklasse mit REXX? (von: Andreas Schnellbacher, 18:03:52) | ^ |
Moin REXX-Kumpels,
weiss jemand, wie man von einer Datei die Objektklasse aendern kann? Ab und zu kommt es vor, dass man eine Datei mit falscher Endung hat. Diese bekommt dann automatisch (solange noch keine EAs vorhanden sind) eine Objektklasse zugewiesen. Diese kann man dann ueber Einstellungen->Objektklasse aendern. Zusaetzlich muss dann aber noch DEFAULTVIEW=DEFAULT gesetzt werden. Beliebte Kandidaten sind Dateien mit folgenden Endungen: .drv -- wenn es kein Druckertreiber ist: WPPrinterDriver statt WPDataFile .rex -- Klasse WPDataFile statt WPCommandFile [ Leser: 133 ] |
29.07.2000 |
z.B. mit zwei Funktionen (von: GA, 13:51:12) | |
1. Als Standdarffunktion in REXXUTILDLL
SysSetObjectData 2. In WPTOOL.DLL die Funktion WPToolsSetObject, siehe: http://www.os2ss.com/information/kelder/wptools.htm Mit beiden Routinen kann eine bestehende Objectklasse geändert werden. Beispiele findest du unter Angabe des Names der Funktion miit einer Suchmaschie(z:b. heir vom Helpdesk aus) im Netz. |
Re: z.B. mit zwei Funktionen (von: Andreas Schnellbacher, 19:11:29) | |
Moin Gerhard,
hast Du das wirklich schon mal mit SysSetObjectData hingekriegt? Ich meine naemlich, das geht nicht. Mir ist kein setup string wie 'CLASS=WPDataFile' bekannt. Dies funktioniert bei mir nicht. Fuer WPTools 3.2 gilt das gleiche, da WPToolsSetObjectData wohl dieselbe C-Funktion benutzt. Im Netz hab' ich trotzdem gesucht und nix gefunden. |
30.07.2000 |
Zur Subklasse WPDataFile (von: GA, 14:50:17) | |
Die Klasse WPDatafile gehört zu den WPS Klassen von OS/2 v4.0
Die Klassenhierarchie baut sich wie folgt auf: SOMObject ---> WPObject ---> WPFilesysten --->WPDataFile Die Subklasse WPDataFile hat folgende Subklassen: WPHtml WPIcon WPImageFile ---> WPBitmap WPMet WPPif WPPOinter WPPProgramFile ---> WPCommandFile WpUrl Der interne Aufbau der Subklasse WPdatafile wird in der Datei wpdataf.idl gezeigt: // Module Header // // Module Name: WPDATAF // // OS/2 Presentation Manager Workplace class definitions // // Copyright (c) International Business Machines Corporation 1991, 1992 // #ifndef wpdataf_idl #define wpdataf_idl #include "wpfsys.idl" #include <somcls.idl> interface M_WPDataFile; interface WPDataFile : WPFileSystem { ULONG wpAddBecomePage(in HWND hwndNotebook); ULONG wpAddFileTypePage(in HWND hwndNotebook); BOOL wpPrintMetaFile(in PPRINTDEST pPrintDest); BOOL wpPrintPifFile(in PPRINTDEST pPrintDest); BOOL wpPrintPrinterSpecificFile(in PPRINTDEST pPrintDest); BOOL wpPrintUnknownFile(in PPRINTDEST pPrintDest); WPObject wpQueryAssociatedProgram(in ULONG ulView, in PULONG pulHowMatched, in PSZ pszMatchString, in ULONG cbMatchString, in PSZ pszDefaultType); void wpSetAssociatedFileIcon(); HPOINTER wpQueryAssociatedFileIcon(); BOOL wpSetContentsFromPointer(in PVOID pData); PVOID wpQueryPointerFromContents(); BOOL wpSetContentsFromHandle(in LHANDLE handle); LHANDLE wpQueryHandleFromContents(); BOOL wpRenderFromClipboard(in ULONG aRenderAs); VOID SetUpdateIndicator(in ULONG ulBidiSetting, in BOOL flSet); BOOL QueryUpdateIndicator(in ULONG ulBidiSetting); VOID SetNeedSave(in BOOL flNeedSave); BOOL QueryNeedSave(); VOID wpSetDefaultBidiSettings(in ULONG ulBidiSetting, in BOOL flSet); BOOL wpQueryDefaultBidiSettings(in ULONG ulBidiSetting); VOID wpSetBidiValues(in ULONG ulBidiSetting, in ULONG ulBidiValue, in ULONG ulBidiMask); ULONG wpQueryBidiValues(in ULONG ulBidiSetting); BOOL wpInsertBidiPage(in HWND hwndNotebook, in ULONG ulBidiSettings); BOOL wpSaveBidiState(); BOOL wpRestoreBidiState(in ULONG ulReserved); void wpInitBidiData(); BOOL wpBidiSetup(in PSZ pszSetupString); HWND wpSettingsNotebook(); #ifdef __SOMIDL__ implementation { releaseorder: wpAddFileTypePage,wpPrintMetaFile,wpPrintPifFile, wpPrintPrinterSpecificFile,wpPrintUnknownFile,wpQueryAssociatedProgram, wpSetAssociatedFileIcon, wpQueryAssociatedFileIcon, wpSetContentsFromPointer, wpQueryPointerFromContents, wpSetContentsFromHandle, wpQueryHandleFromContents, wpAddBecomePage, wpRenderFromClipboard, undefined1, wpSetDefaultBidiSettings,wpQueryDefaultBidiSettings, SetUpdateIndicator,QueryUpdateIndicator,wpSetBidiValues, wpQueryBidiValues,SetNeedSave,QueryNeedSave, wpInsertBidiPage, wpSaveBidiState, wpRestoreBidiState, wpBidiSetup, wpInitBidiData, hwndSettingsNotebook, wpSettingsNotebook; externalstem = wpdf; local; externalprefix = df_; majorversion = 1; minorversion = 2; filestem = wpdataf; metaclass = M_WPDataFile; callstyle = oidl; dllname = "pmwp.dll"; passthru C_h = " #define MAX_ASSOC_ITEMS 12"; passthru C_h_after = " #define DebugBox(title, text) WinMessageBox( " " HWND_DESKTOP, " " HWND_DESKTOP, " " (PSZ) text, " " (PSZ) title, " " 0, MB_OK | MB_INFORMATION) "; wpDragOver: override; wpRestoreState: override; wpSetDefaultView: override; wpSetRealName: override; wpSetType: override; wpAddSettingsPages: override; wpAddObjectWindowPage: override; wpOpen: override; wpPrintObject: override; wpModifyMenu: override; wpMenuItemSelected: override; wpMenuItemHelpSelected: override; wpQueryDefaultHelp: override; wpFormatDragItem: override; wpConfirmRenameFileWithExt: override; wpQueryIcon: override; wpSaveState: override; wpInitData: override; wpSetup: override; wpRender: override; somDefaultInit: override; somDestruct: override; wpConfirmKeepAssoc: override; }; #endif /* __SOMIDL__ */ }; interface M_WPDataFile : M_WPFileSystem { ULONG wpclsAddClipboardAssoc(in ULONG aCBFormat, in PSZ pszClassName); ULONG wpclsEnumClipboardClasses(in ULONG aCBFormat, in ULONG aPrevious); #ifdef __SOMIDL__ implementation { releaseorder: wpclsAddClipboardAssoc, wpclsEnumClipboardClasses; externalstem = wpdf; local; externalprefix = dfM_; majorversion = 1; minorversion = 2; filestem = wpdataf; callstyle = oidl; dllname = "pmwp.dll"; wpclsQueryTitle: override; wpclsQueryIconData: override; wpclsQueryStyle: override; wpclsQueryDefaultView: override; wpclsQueryDefaultHelp: override; wpclsInitData: override; wpclsUnInitData: override; wpclsQuerySettingsPageSize: override; }; #endif /* __SOMIDL__ */ }; #endif /* wpdataf_idl */ Das erste Argument von SysSetObjectData muß ein Objektname sein, kein Klassenname! Im zweiten Argument wird Bezug genommen auf Schlüsselwerte(key names), die sich auf die WPObject-Klasse, als auch auf die Unterklassen wie WPFolder und WPPprogram beziehen können, um ein Beispiel zu nennen. Die Syntax ist dabei wie folgt: "key1=value1,key2=value2,value3;" Somit werden also multiple Schlüsselnamen durch ein Semikolon, multiple Schlüsselwerte durch ein Komma getrennt. Man geht also so vor, daß man daß Objekt eindeuitig z.B. durch seinen Pfad spzifiziert und dazu im setup string die Parameter angibt, die für die jeweilige Subklasse definiert sind. |
Ein Beispiel zu SysSetObjectData (von: GA, 18:55:58) | |
Dieses Beispiel zeigt eine Einafche Anwendung:
Syntax: result = SysSetObjectData(name, setup) name The object name. This can be specified as an object ID (for example ) or as a fully specified file name. setup A WinCreateObject setup string. result The return code from WinSetObjectData. This will return 1 (TRUE) if the object was updated and 0 (FALSE) if the object was not updated. Purpose: Change the settings of an existing object. It can also be used to open an instance of an object. Examples: /* Code */ if SysSetObjectData("MyProgram","NOMOVE=YES") Then Say "Myprogram object settings have been updated." In this example, the object style is being changed, obviously in an attempt to 'user-proof' the program reference object. Other useful strings for Workplace Shell objects generally (i.e. these are supported by the base class, WPObject) aus:http://www.lesbell.com.au/REXXobj.html Ich bin allerdings zu der Ansicht gekommen, daß diese Funktion naicht das leistet, was du möchtest. Ich neige jetzt zu der vermutung, daß mit SysPutEA du zum Ziel kommst, weil die Parameter der Files der Klasse WPDatafile in den EAs abgespeichert ist. |
31.07.2000 |
Ändern mit SysCreateObject (von: GA, 14:33:12) | |
Im Letzten Argument von SysCreateObject gibt es das optionale Angabe, die bestimmt
a. ob das Objekt ersetzt werden soll, wenn es bereits existiert. Dann gibt man den Parameter als REPLACEIFEXIST oder mit 'R' an. b. wenn das Object noch nicht existiert. Dann gibt man den Parameter FAILIFEXISTS oder mit 'F' an. Dies ist aber auch der Standard-Wert c. wenn das Object verändert werden soll. Dann wird der Parameter UPDATEIFEXISTS oder 'U' an. Dies letzte Variante ist die, die du anwenden möchstest. Denn hier kannst du für eine Datei(das Objekt) die Objektklasse ändern. |
01.08.2000 |
Klasse mit SysPutEA aendern? (von: Andreas Schnellbacher, 13:27:08) | |
Moin Gerhard,
natuerlich sind es die EAs, in denen die Klassen-Info abgelegt ist. Das EA heisst ".CLASSINFO"! Weisst Du irgendwas ueber die Syntax, bzw. an welchen Bits die Objektklasse angegeben ist. Welche Zeichen muss man dann noch bei SysPutEA angeben, damit der String richtig abgeschlossen wird? Dabei interessiert mich weniger die Syntax von SysPut/GetEA, sondern der Aufbau des EAs .CLASSINFO. Es scheint sehr schwierig zu sein hierueber etwas zu finden. Wahrscheinlich geht es einfacher mit dem Erzeugen einer leeren Datei ueber SysCreateObject und dem Kopieren des Inhalts in diese Datei mit copy. Woher holt sich die WPS eigentlich die Default-Objektklasse, wenn .CLASSINFO nicht existiert? Dies kann ja nur die Endung sein. Kann man dieses Verhalten beeinflussen? Welche Rolle spielt dabei der Objekttyp? |
02.08.2000 |
Nochmals: Mit SysCreateObject Paramter ändern! (von: GA, 08:40:55) | |
Problem: Modifizieren der KLasse WPDataFile ---> WPPrintDriver
Voraussetzung: Das Objekt wurde mit SysCreateOBject erstellt und existiert Aktion: Aufruf von SysCreateObject mit der Option UPDATEEXISTS bzw 'U' Programm: /* Modifikation eines existierenden Objects mit SysCreateObjects */ F RxFuncQuery("SysCreateObject") THEN DO RC = RxFuncAdd("SysCreateobject","RexxUttil","SysCreateObject") IF (RC) THEN DO SAY "REXX - Funktion SysCreateObject konnte nicht registriert werden" EXIT END ELSE CALL SysCreateObject END CLASS = 'WPPrintDriver' TITEL= 'EPSON - XYZ' FOLDER = '<TESTFOLDER>' OPTIONS= 'OBJECTID=<TESTfDRIV>ER>' || 'EXENAME=X:DRIVERSEP05.DRV' ACTION = 'U' RC = SySCreateObject(CLASS,TITEL,FOLDER,OPtIONS, ACTION) IF( RC) THEN say ' Das Objekt mit dem Titel ' , TITEL , 'konnte nicht modifiziert werden' EXIT Hinweis: Einige Informationen, wie .CLASSINFO aufgebaut ist, findet man hier. Aber dies zu lesen, würde ein C++ Programm mit biärenOperationen bedeuten. Das ist aber jedoch nicht erforderlich, wenn schon ein EA für ein Object existiert. Dann kann man es eben wie gezeigt mit SysCreateObject modifizieren. Die Quelle: http://www.cs.wayne.edu/~tom/guide/os2.html |
06.08.2000 |
Re: Nochmals: Mit SysCreateObject Paramter ändern! (von: Andreas Schnellbacher, 15:37:22) | |
Moin GA,
besten Dank fuer Deine Infos. Leider hat es mir bis jetzt nicht weitergeholfen. Wie ich geschrieben habe, moechte ich z.B. eine .drv-Datei von WPPrinterDriver nach WPDataFile aendern. Du hast den umgekehrten Fall beschrieben. Deinen Vorschlag habe ich auf dieses Problem angewendet: funktioniert nicht. OK, Du hast ja auch Einschraenkungen genannt. Dein Beispiel habe ich dann mal ausprobiert (nach Bereinigung aller Fehler): funktioniert genauso wenig. Die Klasse heisst uebrigens WPPrinterDriver. Als letzte Moeglichkeit bleibt also das EA .CLASSINFO zu editieren. Das ist wohl mehr was fuer WPS- und C-Goetter. |
CLASSDEFAULTVIEW --- ein "neuer" Setup-String (von: Andreas Schnellbacher, 15:39:23) | |
Fuer neue Objekte kann man die Zuordnung aendern:
aus REXX Tips und Tricks 3.0 (rxtt30.zip) ----------------------------------------- Beginning with WARP 4 Fixpack #1 there is a new keyword to set the default view for a class of files. The syntax for this keyword is: Class: WPDataFile (?) Key name: CLASSDEFAULTVIEW Value: view_name Description: "view name" is the name of the view as it appears in the'context menu for the object. For convenience, spaces or control characters such as carriage returns, line feeds, or tabs may be omitted (or replaced with a blank). Note that this changes the default view for new objects - not for existing objects! For example, to change the default view for new .FLC files to Video Editor you may use the following code: /* sample code to change the default view for new .FLC files */ call rxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs" call SysLoadFuncs say SysSetObjectData( 'C:OS2APPSKLONDIKE.FLC',, 'CLASSDEFAULTVIEW="Video Editor"' ) To get another example for using this feature, see the file OS2SETDEFV.CMD |
Weitere Annahmen (von: GA, 16:33:07) | |
1. Mein Beispiel sollte eine ungefähre Darstellung zeigen. Bei deinem Objekt sollten exakt die Parameter angegeben werden, die auch zutreffen.
2. Mit 'R' kann das existierende Objekt gelöscht werden, ein neues wird erzeugt. Vielleicht testest du das mal mit einem Versuchsobjekt. 3. Wie unter C, C++ und auch unter REXX muß man manchmal viel Phantasie entwickeln, neben einer gewissen Hartnäckigkeit, um zum ZIel zu kommen. Es hängt oft nur an Kleinigkeiten. Ich schlage vor, daß du mal an einem Versuchsobjekt mit einfachster Konfiguration die Option mit 'U' und 'R' testest. |
Weiterer Hinweis(I) (von: GA, 16:43:03) | |
Hier findest du nohmals den Hinweis, mit SysCreateObject eine vorhandene Klassenzuordnung zu ändern:
http://www.white-tower.demon.co.uk/wps/PCM02.html |
Eine REXX-Routine mit der UDATE-Option mit... (von: GA, 16:58:45) | |
SysCreateObject an zwei Beispielen:
http://www.toward.com/cfsrexx/mkwinos2/mkwinrun.txt P.S: Endlich kann ich im Netz mal auf etwas zugreiden, was ich selber mit (wieder) iniitiiert habe. |
08.08.2000 |
Protokoll der Routine EADUMP (von: GA, 11:35:04) | |
Dieses Protokoll der Routine EADUMP der Graham Utilities zeigt einige Details der EAs:
http://www.warpspeed.com.au/eadump.htm Die Quelle liegt in Australien, so daß der Ladevorgang am Tage etwas dauert. |
03.09.2000 |
Extended Attributes mit REXX lesen und setzen (von: GA, 17:47:56) | |
V.CMD - Saving Extended Attributes with REXX
After putting together this code I got the idea that perhaps folks might be interested in having a monthly learning REXX article in the Newsletter. To that end starting next month see this space for Beginning with OS/2 REXX. Below is a piece of REXX code that I (literally) threw together in about half an hour. The concept behind this code is simple: I needed to keep track of what changes I had made to various files as part of a project. Of course, with most files you can't just add a chunk of text at the top and still have them useful for their intended purpose (ie: Binary files, WP/AmiPro documents, WAV files, etc.) so I had to have another way of saving data along with the file itself. Guess what? OS/2 does just this function with EXTENDED ATTRIBUTES. Under the FAT file system OS/2 saves the Attributes in that irritating file EA_DATA._SF. Under HPFS the Attributes are saved with the file. In both cases the way that we create and modify these Attributes is the same. The REXX additional function library (REXXUTIL.DLL) that is included with OS/2 (and documented in the Online REXX manual) gives us this special function. Using the functions called SysGetEA and SysPutEA we have the ability to place and retrieve EXTENDED ATTRIBUTES to any object in OS/2. The code below uses these functions within a wrapper of REXX to add additional function to our Editor of choice. By passing one of the parameters to the program we can CREATE, ADD to, DELETE or VIEW any comments to file we edit. In fact we can even modify the comments without even editting the file. In this example we simply add an EA called VERLOG (because I was using the EA's to track Versions of my files) and use that to hold our comments. For your own use you can use this EA, or additional EA's to store ANY information you want with a file. You can save comments, the name of the updater, the name of the editor used to edit the file or any other information you want to keep track of. Just save this HTML Page to a file called V.CMD, remove anything above AND below the first and last REXX comments (the /***....***/ lines) and save the file. The file is also part of this month's Shareware Disk. You should have 127 lines in the final file and the first line must be the first REXX comment line. Type V and the program should show you it's own help screen. /********************************************************************OS2*REXX*/ /* V.CMD */ /* */ /* 960224 - Terry Hamilton - TCH Consulting Services */ /* */ /* Function: Allows adding of Comments to a file as an EXTENDED ATTRIBUTE */ /* (can also add comments to a Directory by using only /a!) */ /* */ /* Operation: Simply type "V filename" to edit a file */ /* After edit you will be prompted for a comment */ /* Null (blank) comments are ignored */ /* Type V /? for detailed commands */ /* I use it to add version/change info to my files. */ /* */ /* Requires: REXXUTIL.DLL in the Libpath (as per a regular OS/2 install) */ /* */ /* Customize: To use a specific EDITOR change the EDITOR variable below */ /* You could easily modify to select editor based on extension */ /* */ /* Copyright: None. Free for use by anyone and everyone. */ /* No Warranties express or implied. Use at your own risk. */ /*****************************************************************************/ /* Edit this line to specify your favoriate editor */ EDITOR = "TEDIT.EXE" /* Load REXXUTIL functions (to access the EA's) */ call rxfuncadd "sysloadfuncs", "rexxutil", "sysloadfuncs" call sysloadfuncs /* Get command line parameters */ parse arg fname comment /* Decide how to handle the file */ select /* User asked for help */ when fname = "/?' then do say; say say "Utility to add EA Comments to a file." say " If you type:" say " V filename " say " you will edit the file with "EDITOR" and the V.CMD" say " will ask for a comment to add to the file EA's." say say " Parameters:" say say " V fname commenttext - edit and add these comments" say " V fname /s - SHOW current comments" say " V fname /a - ADD a comment without editting" say " V fname /K - KILL (delete) all comments (Capital K!)" say " V fname /n - edit without prompting for comments" say " V /? - this HELP screen" say say " Example:" say " V config.sys Increasing SWAPPER size" say " Edit CONFIG.SYS adding this comment to the EA's" say " V config.sys /s" say " Show the comments I have for CONFIG.SYS" end /* SHOW EA's */ when comment = "/s' then do rc = SysGETEA(fname,"VERLOG","VAR") do until pos(D2C(1),var)=0 parse value var with line '' var say line end say var if var='' then say "No Comments" end /* KILL (delete) any EA's (Case SENSITIVE!) */ when comment = "/K' then do rc = SysPUTEA(fname,"VERLOG","") say; say 'Comments deleted' end /* Edit without adding a comment */ when comment = "/n' then '@'EDITOR fname /* Add a comment and DON'T EDIT */ when comment = "/a' then do say "Enter Comment:" parse pull comment call addcomm end /* Edit then prompt for a comment */ when comment = '' then do '@'EDITOR fname say say "Enter Comment:" parse pull comment call addcomm end /* User supplied a comment on initial command line */ otherwise do '@'EDITOR fname call addcomm end end /* Single exit point */ Exit /* If comment isn't blank append it to the VERLOG EA */ addcomm: if comment<>'' then do rc = SysGETEA(fname,"VERLOG","VAR") comment = var||D2C(1)||date('O') time()" - "comment rc = SysPUTEA(fname,"VERLOG",comment) end return /*****************************************************************************/ Click here to return. |
Objektklasse A E N D E R N geht nicht mit SysCreateObjekt! (von: Andreas Schnellbacher, 19:29:55) | |
Moin GA,
neulich hab' ich nochmal alles sorgfaeltig ausprobiert. Ergebnis leider wie ich schon am Anfang gesagt habe: Man kriegt mit SysCreateObject die Objektklasse nicht geaendert. Mit 'UPDATE' wird die Objektklasse nicht angeruehrt. Einzige Moeglichkeit ist 'REPLACE' zu verwenden. Dann wird aber das alte Objekt geloescht und ein neues Object der gewuenschten Klasse erzeugt. Das waer's schon fast --- wenn nicht der Inhalt des alten Objekts verloren waere. Trotzdem aber besten Dank |
11.09.2000 |
Re: Objektklasse A E N D E R N geht nicht mit SysCreateObjekt! (von: Peter W., 09:50:26) | |
Hallo Andreas und GA,
mal abgesehen von jeglichen Versuchen usw. zum Ändern der Objekteigenschaften. Irgendwo im REXX Buch für OS/2 kann ich mich an eine Stelle erinnern wo sinngemäß steht, dass SysSetObjectData meistens nicht funktioniert. Bei mir funktioniert es tatsächlich mit einigen Eigenschaften von Referenzen. z.B. ICONFILE funktioniert wiederum nicht. Wie auch immer, eigentlich wollte ich nur den Vorschlag machen, mal bei Heinz Wolek nachzufragen unter: http://www.ww-dv.de/forum/index.html Er freut sich über Anfragen... |
Mit SysCreateObjekt nur bestimmte Argumente.. (von: GA, 12:24:15) | |
angeben soll man, wenn man etwas ändert.
Mit anderen Worten, man soll nur das Argument angeben, was geändert werden soll. Also neben der ID und dem Update Parameter z:B. die Objektklasse . Aber das muß auch noch verifiziert werden. Aber vielen Dank für den Tip! Jetzt kann man Heinz Wolek direkt ansprechen, und das ist wunderbar! |
Re: Mit SysCreateObjekt nur bestimmte Argumente.. (von: Sebastian Wittmeier, 17:35:16) | |
Vergesst nicht die Möglichkeiten von Object Rexx:
Previously, traditional REXX provided some access to Workplace Shell objects from REXX utility functions (such as SysQueryClassList, SysCreateObject, SysSetObjectData and so on). Now you have access to all workplace classes and methods. The following example shows how to create a folder on the desktop by sending a wpclsNew message to the WPFolder class. folder = .wpFolder~wpclsNew('New Folder', /* Folder will have title "New Folder" */ '', /* No Specific Setup String */ .wpDeskTop, /* Create new folder on the Desktop */ 1) /* Lock the object to start with */ folder~wpOpen(0,0,0) /* Open the folder (Default View) */ folder~wpClose /* Now close the folder. */ Quelle: REXXPG.INF, IBM DEVELOPER'S TOOLKIT FOR OS/2 WARP VERSION 4 http://service2.boulder.ibm.com/devcon/devcon/docs/warptlkt.htm Achtung! Dafür ist Professional-Level nötig! Inoffizieller Mirror (bei "Verbindungsproblemen"): ftp://ftp.simcb.ru/john/os2/warptlkt.zip |
13.09.2000 |
Re: (von: Andreas Schnellbacher, 20:37:18) | |
Moin Leute,
schoenen Dank fuer Euer Interesse, aber es geht tatsaechlich nicht ohne SysPutEA. |
06.05.2001 |
So geht's (von: Andreas Schnellbacher, 00:52:12) | |
Vielleicht interessiert es ja sonst noch jemanden:
Aus news:comp.lang.rexx Betreff: Re: Changing Object Class in OS/2 Datum: Sat, 05 May 2001 20:57:42 +0200 Russell O'Connor wrote: > > Does anyone know what REXX system commands I can call in order to > change an object type? For example to turn a MMWAV object into > an MMAUDIO object. There are no REXX functions to do this as easy as with the settings page in Warp 4. Therefore you must create a new (empty) object and add the data of the old object. /* REXX */ say call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' call SysLoadFuncs /* Get old object */ OldObject = stream( 'Test.wav', 'c', 'query exists' ) if OldObject = '' then return Title = filespec( 'n', OldObject ) Location = directory( OldObject'..' ) TempTitle = Title'.temp' TempObject = strip( Location, 'T', '' ) || ''TempTitle Class = 'MMAudio' Setup = '' /* Rename old object to *.temp */ 'ren 'OldObject' 'TempTitle /* Create new empty object with old object title */ ret = SysCreateObject( Class, Title, Location, Setup, 'R' ) /* Add temp object to new empty object */ 'copy 'OldObject' + 'TempObject' /b 'OldObject /* Delete temp object */ call SysDestroyObject TempObject return -- Andreas Schnellbacher |
Ja, wunderbar, Andreas! (von: GA, 14:38:01) | |
Das ist wirklich eine elegante Lösung. Ich habe noch zum COPY - Statement eine Frage.
Fehlt nicht am Ende ein '' zum Abschluß? |
Re: Ja, wunderbar, Andreas! (von: Andreas Schnellbacher, 18:07:15) | |
Noe, das sind ja alles REXX-Variablen.
Das hab' ich nochmal vor: * Ermoeglichung von Drag'n'Drop und Starten aus Kontext-Menue des Objekts heraus. Z.Zt. kann das Objekt dann nicht umbenannt werden, da es gestartet wurde. Das geht einfach mit der Erstellung eines 2. REXX-Programms oder eines Programmobjekts, das die Parameter vom 1. uebergeben bekommt. * Uebernahme der alten EAs ausser .CLASSINFO |
( Zeige die Threadübersicht ) | [ Version zum Drucken ] | ( Zur Startübersicht ) |
|
Mit * markierte Felder müssen ausgefüllt werden ! |
|