elevator,
Run() methods are usually the main routine in scripts. IF you have the run method itself, then you'll want to copy that to the Clipbaord, create a new script in Paradox, and then paste your code into the run method of the script (which is automatically created for you).
Use care to not duplicate the first and last lines of the method, e.g:
Code:
method run(var eventInfo Event)
; your code goes here...
endMethod
Now, if you have problems running that, then you may need to troubleshoot the code in question. Here are a few tips:
1. Make sure you're seeing all the tools available to you. To do this, go to the General tab of the Developer Preferences dialog (yypically invoked using Tools | Settings | Developer Preferences). Set ObjectPAL Level to Advanced, check the enable debug() statement under Debugger settings, and check the Show Developer menus option. Choose OK to save these changes.
2. You will design a form, script, or library, you will now see a Program item in the main menu, which contains a couple of useful troubleshooting options. With your script open, choose Program | Compiler Warnings and Program | Compile with Debug. Note that these are flags that control the way Paradox saves your files that contain code.
These settings will a) display all errors (not just critical ones) using dialog boxes and b) provide more information, including the line number, about the problem.
Please note that you need to save your file for these new settings to take effect.
Now, if you have a script and are having problems executing it from a form, you'll want to place a button on the form, open its pushButton() event, and then add something like this:
Code:
play "myscript"
If nothing happens, then it's possible that there's a problem. If it's a major problem (at least as far as Paradox is concerned, an error dialog will appear with details. However, Paradox displays certain errors in the status line, which is pretty easy to lose track of--especially if you use the mouse heavily.
In that case, change your pushButton code to something like:
Code:
errorTrapOnWarnings( Yes )
play "myscript"
Run the form and then click the button. Yes, this will trigger the same problem, however, you'll now see the error dialog on all errors, not just the ones that Paradox can ignore.
In most cases like the the dialog will say something like "The design object could not be opened" (if you've set the Program menu settings listed earlier, you'll get the line where the error was encountered and a bit of code on that line). IF this is the error you're seeing, take note of the second button on the dialog, specifically the
button.
This is enabled whenever there's more information available. Get into the habit of looking for this whenever you see error dialogs, for it frequently leads you to the most relevant information about the specific problem. In this case, clicking it leads to a message saying "Cannot find myscript." (which is Paradox's way of saying, "File not found"

.
Now, that's the basics. If that doesn't help, then feel free to follow-up with the additional information you learn from the process.
Hope this helps...
-- Lance