OK, it's not actually code but I thought this might help somebody. It includes some additional info about using the new "Sys_print()" function in A5v4.5 build 266. (It also may help some with the Sys_open() command.) It's intended to help those who are not real familiar with file associations. The attached file is an HTML file identical to what is below in case anyone wants to save it on their own computer for future reference.
Sys_print()
Version: 4.5 build 266
Syntax: Sys_print( "File_to_print" )
Description:
This function does the same as right clicking on a file in the Windows Explorer and choosing the Print command. Alpha Five will print the file using the application associated with the file's extension.
For example, assuming that filename is "c:mydatainvoices.doc" and that on your computer, the ".doc" file extension is associated with Microsoft Word, then Alpha Five will open the file using Word and immediately print the file then close Word.
NOTE: The file type must have an associated program to run it AND the file association must define a "print" option. If the "print" option is not defined, the file will be opened using the associated program but will not be automatically printed. Also, at the current time there seems to be no way to check the results of the command within XBasic.
To check file associations, click "Start/Settings/Folder Options/File Types" and search the list for the file extension you wish to use. Option: You can also check file associations from the Explorer window by clicking "View/Folder Options/File Types". (Recommendation: Just try the command first - if it doesn't work, then check the file associations.)
Example:
The following Xbasic command could be attached to a button on form. Assuming that Word is associated with the printing of ".doc" files, then when the user presses the button, Alpha Five will open Word, automatically run the print command, and close Word.
sys_print( "D:a5v45readme.doc" )
Sys_print()
Version: 4.5 build 266
Syntax: Sys_print( "File_to_print" )
Description:
This function does the same as right clicking on a file in the Windows Explorer and choosing the Print command. Alpha Five will print the file using the application associated with the file's extension.
For example, assuming that filename is "c:mydatainvoices.doc" and that on your computer, the ".doc" file extension is associated with Microsoft Word, then Alpha Five will open the file using Word and immediately print the file then close Word.
NOTE: The file type must have an associated program to run it AND the file association must define a "print" option. If the "print" option is not defined, the file will be opened using the associated program but will not be automatically printed. Also, at the current time there seems to be no way to check the results of the command within XBasic.
To check file associations, click "Start/Settings/Folder Options/File Types" and search the list for the file extension you wish to use. Option: You can also check file associations from the Explorer window by clicking "View/Folder Options/File Types". (Recommendation: Just try the command first - if it doesn't work, then check the file associations.)
Example:
The following Xbasic command could be attached to a button on form. Assuming that Word is associated with the printing of ".doc" files, then when the user presses the button, Alpha Five will open Word, automatically run the print command, and close Word.
sys_print( "D:a5v45readme.doc" )
Comment