SR DBpro plugin
Dlls still beging worked on.
1. SR-Email
2. SR-Printer
3. SR-FTP
4. SR-File
5. SR-System
6. SR-HTML
7. SR-Message box
8. SR-Other
41 Commards so far
here is the full commard list so far with help.doc file in here to
SR Plugin
By Simon Phillips (warship45@hotmail.com)
1. SR-Email
2. SR-Printer
3. SR-FTP
4. SR-File
5. SR-System
6. SR-HTML
7. SR-Message box
8. SR-Other
SR-Email
SR-Email plugin allows the DBPro application to send email using SMTP and using the pop3 commands in this set to receive the last email sent to an account.
Command list:
Returns int=SREConnectSMTP(IP$,Username$,Password$)
This function will connect to any SMTP email server, if it connects a 1 is returned if 0 is returned then the connection failed. IP$ is the host address e.g. mail.0z0.co.uk, username is the username and password is password.
SRESetupSMTP “youremail”,”Emailto”,”Subject”
This Command allows you to setup the email message with your email address which must match the email address link to the account you have connected to, email to is the email address you want to send to and finally the subject is the subject of the email.
SREAddlnSMTP “email message”
This will add a new line to the body of the email that you had just created. Email message is the message to go onto the line is you leave it blank then a blank line is added.
SRESendSMTP
The Command will send the email that you have created using the SREAddlnSMTP and SRESetup. You must be connected to the SMTP server in order for this Command to work.
SREDisconnectSMTP
This will disconnect you from the SMTP server you are currently connected to, if you are not connected to a server the Command will fail.
Return int=SREConnectPOP3(ip$,Username$,Password$)
The SREConnectpop3 Command is just the same as the SREConnectSMTP if a 1 is retuned it connected if a 0 is retuned then it was unable to connect. IP$ is the host address e.g. Mail.0z0.co.uk. The username is the username and password password.
SREGetmailpop3 “filename”
This Command gets the last message sent to your pop3 account it then downloads it and saves it into a folder as the filename you give it above. It is saved in html format.
SREDisconnectpop3
This command will disconnected you from the current pop3 server much the same as the SREDisconnectSMTP server.
Return int=SREMessagenumberpop3
This command will return the number of messages that are available for download you should use this with the SREGetmailpop3 to ensure you are downloading a message that exists.
SR-Printer
SR-Printer plugin for DBPro allows the darkbasic application to use the printer that is set as your default printer. You are able to print text anywhere on the page also you are able to print the screen that is currently showing to the printer this will allow you to print anything shown on your dbpro application.
Command list:
SPRGetprinterlist
Will get the list of printers that your are able to print out of using commard SRPNumberofprinters and SRPprintername to get the name and the number of printers in the list.
Returns int=SRPNumberofprinters()
This will return the number of printers that SRPGetprinterlist found use this with SRPprintername to get the name of a printer.
Returns String=SRPPrintername()
This will return a start of the printer found run this command over and over until you have got to the SRPnumberofprinters if you carry on running it after this a 0 will be returned.
SRPSetnewprinter Printername$,Driver$
The command will set a new printer to print from use SRPPrintername to get the name of the printer then use this command to set it for printing. The driver string is normal WINSPOOL however it is not allways.
SRPStartdoc
The Command will create a new text doc ready for you to add text to you do not need this Command if you are going to use the SRPprintscreen Command as this Command will create it's own and print out.
SRPSettextcolor Colornumber
This command will change the color of the text you want to add to a page Number to color chart shown below.
0=Black
1=White
2=Blue
3=Green
4=Gray
5=Yellow
6=Purple
7=Lime
8=Olive
9=Teal
10=Red
11=Silver
12=SkyBlue
13=Aqua
14=Fuchsia
15=Maroon
16=MoneyGreen
17=MedGray
18=Navy
19=Cream
20=DkGray
SRPAddtext “Text to add”,x,y,textsize
This will add a bit of text to the page you have created with the SRPStartdoc. The x and y int's are for you to tell the page where you would like to place the text on the page e.g. 10,60 the textsize is the same as font size in word it makes it bigger or smaller depending on the number.
SRPAddimage “image name”,x,y
This command will add a bmp or jpg image to the page you have created, you must have used SPRStartdoc before using this command or it will falue.
SRPTextfont “Fontname”
This will Change the font for the text you are going to add to the page e.g. Courier New. You must run this Command before adding the text to the page or it will only change for the next text added.
SRPNewpage
Will create a new page for the next bit of text you add to a page, once you run this Command you will be unable to return to the first page if you had to add anything else to that page.
SRPCopies numberofcopyes
This Command will tell the printer how many copy's of the doc you are creating it wants it to print out.
SRPTitle Title$
Will give the doc a title the title must be a string and used before you print the doc.
SRPStartprint
This will start printing the doc that you have created with the commands above.
SRPAddscreenshot x,y
The Command will add a screenshot of what ever is showing on the page to the page you are creating for printing.
Return String=SRPGetcurrentprinterdriver
This command will return a string of the current printer driver.
Return String=SRPGetcurrentprintername
This command will return a string of the printer name.
SR-FTP
SR-FTP plugin allows you to connect to any ftp server, change dir download files and put files.
Command list:
Returns int=SRFConnect(IP$,Username$,Password$)
This function will connect to any FTP server, if a 1 is returned it successfully connected if 0 then unable to connect.
Returns int=SRFStartus
This function will return a 1 if the connection was successful and you are connected otherwise a 0 is returned.
Return int=SRFDirexist(Dirname$)
This command will check if a dir exists on the ftp server that you are connected to. If a 1 is returned then it does exist if a 0 then it does not exist.
SRFChangedir Dirname$
This will change the dir one the ftp server make sure the dir exists with SRFDirexist command before running this or it may error.
SRFChangedirup
This will change the dir up one level.
Return int=SRFFileexist(Filename$)
This will check if a file exists in the current dir of the ftp server.
SRFDeletedir dirname$
Will delete a dir on the ftp server.
SRFCreatedir Dirname$
Will create a dir on the ftp server the dir name must not exist or an error will be returned.
SRFFindfirst
This command is used with the SRFFindnext and SRFGetfilename to search the server for files use this command to generate the list then the SRFGetfilename and SRFFindnext to get the names out of the list that the first command has created.
Return string=SRFGetfilename
Use this with the SRFFindnext and SRFFindfirst to get the names of the files on the ftp server. SRFFindfirst will start the search and the SRFFindnext to continue it.
Return int=SRFFindnext
This command will continue the search if a -1 is returned then that is the last file in the list for searching and then you should not call the SRFGetfilename command after the -1 has been returned otherwise a 0 is returned.
SRFGetfile FTPFilename$,Localfilename$
Will download a file from the ftp server the localfilename must be the same name as the file on the ftp server however it can be placed into any folder on your computer.
SRFPutfile Localfilename$
This will upload a File to the ftp server from a local file.
SRFDisconnect
Will disconnect you from the FTP server you were disconnected.
SRFPort portnumber
Will change the port that the ftp server is going to connected onto you do not need to set this if the ftp server uses port number 21 .
More commards are being added to these plugins this is just how far i have got at the moment.
At the bottom of this message you will find an attachment that contains SR-Email and SR-Printer demo versions which will allow you to call the commards 10 times on each each time you run your exe if you could please test the dll and tell me of any bugs you get that would be very helpfull, there is an error system however i will be posting it later on.
dbpro plugins
www.0z0.co.uk