FileExists
PowerScript event
Description
Occurs when a file is saved in the RichTextEdit control and the file
already exists.
Event ID
|
Event ID |
Objects |
|---|---|
|
pbm_renfileexists |
RichTextEdit |
Arguments
|
Argument |
Description |
|---|---|
|
filename |
The name of the file |
Return Values
Long.
Return code choices (specified in a RETURN statement):
0 — Continue processing
1 — Saving of document is canceled
Usage
The SaveDocument function can trigger the FileExists event.
Examples
This script for FileExists checks a flag to see if the user is
performing a save (which will automatically overwrite the opened file) or
wants to rename the file using Save As. For the Save As case, the script
asks the user to confirm overwriting the file:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
integer li_answer // If user asked to Save to same file, // do not prompt for overwriting IF ib_saveas = FALSE THEN RETURN 0 li_answer = MessageBox("FileExists", & filename + " already exists. Overwrite?", & Exclamation!, YesNo!) MessageBox("Filename arg", filename) // Returning a non-zero value cancels save IF li_answer = 2 THEN RETURN 1 |
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest