GJ Posted March 9, 2005 Share Posted March 9, 2005 I'm attempting a script that will enter a symbol with the definition of "title" and edit an object with the name of "date". I've got the date script written, but I get all kinds of errors in when I try to add it to editing a specific symbol definition. Can anyone help me with this? Attached is the change date and print script I wrote: PROCEDURE DateandPrint; VAR dateNow : STRING; obHd : HANDLE; BEGIN dateNow := DATE(1, 0); obHd := GETOBJECT('Date'); SETTEXT(obHd, dateNow); DOMENUTEXTBYNAME('Print', 0); END; RUN(DateandPrint); Quote Link to comment
MullinRJ Posted March 10, 2005 Share Posted March 10, 2005 GJ, Is the object in the symbol a text object? I ran your script and got no errors changing a text object inside a symbol. VW 10.5.0 on MAC OS 10.2.8. To see the changes to the symbol in your drawing you will have to put a RedrawAll; after the SetText(); command. Even without the RedrawAll;, the printed output showed the updated date. quote: but I get all kinds of errors in when I try to add it to editing a specific symbol definition.Since named objects are unique, you don't have to edit the symbol definition to modify the DATE string inside, just run the code you have above. There will only be ONE object in your file named DATE, and even if it is in a Symbol Definition, GetObject('DATE') will return a handle to it. Can you list the errors you are getting, or the symptoms? Maybe I don't understand exactly what you are doing, so it will help clarify things. Raymond Quote Link to comment
GJ Posted March 10, 2005 Author Share Posted March 10, 2005 Thanks Raymond, Without the RedrawAll, I guess I wasn't seeing that the text was updating inside the symbol after all. Such a simple script, and yet so useful to me. Thanks, GJ Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.