name insert03 group "&Learning"; on command "&Timestamp" file = qedit.activefile; -- we need an object to insert into if typeof(file)=qedit.typeundefined result=dialog("You must have a file open"); stop; -- terminates the script, but not qwin client itself endif; if not exists(file) -- slower way to do the same check result = dialog("You need a file open to insert a signature"); else timestamp = datetime(); result = dialog(string(timestamp)); -- debugging display timestamp = timestamp.fmtshortdatetime(); -- a method, not a function result = dialog(timestamp); -- debug display: formatted timestamp file.insert(timestamp); -- insert the timestamp endif endon << Author: bgreen@robelle.com Date: Nov 5, 1999 Web: insert03.qsl Comments: 1. You will run this script from the Script Menu. 2. Save as '\c:\qslwork.insert03.qsl". 3. Click Menu | Manage Scripts, then click 'Add' and browse to your qsl file. Click OK to add it. The script should now be on your menu under the "Learning" group. 4. Look in Script Menu and click 'Learning'. 5. Click 'insert03' and 'Timestamp' 6. You should see a timestamp appear in your text window at the cursor position. 7. Datetime() returns the current date and time as an Object. 8. 'timestamp.fmtshortdatetime()'is a method of DateTime Object, not a Function, which would be 'fmtshortdatetime(timestamp)'. 9. See Insert02.qsl for explanation of error checking. 10.Dialog() calls are for debugging display; remove them before putting the script into production use. 11. You could have left the On Command "&Signature" block of Insert02.qsl in for two independent modules. See Insert04.qsl >>