I've posted this code in one form or another before, so I'm not going to go into long explanations on the how's and why's; you can search http://jbase.markmail.org if you are interested. Or you can email me off-list to my gmail.com address: danielkleinad
Simply put, all this program is doing is grabbing the spooler output and sending it to a file. However, it is also doing something 'special' with each line of the report (see program lines 19 thru 21); it is testing the required condition in order to process the 'line'. IOW, it will 'print' every line (iow send the line to the sequential file) that does NOT contain a '0.00' in it. If your report is more complex than what you posted then you will have to parse each line as necessary to determine whether or not the 'line' gets 'processed'. [Note: lines 9 and 11 to 13 only work on jBASE 4.1 and above. Let me know if you need a jBASE 3 solution.] 0001 PROGRAM jlp_special 0002 * Redirects spooler output to a text file 0003 * 0004 * Create spooler queue with something like: SP-CREATE TEXTFILE PROG c:\home\bin\jlp_special.exe 0005 * Where: 0006 * 'c:\home\bin' is the directory where the 'jlp_special' executable lives 0007 * 0008 INCLUDE JBC.h 0009 id = CHANGE(UNIQUEKEY(),'/',']2F') 0010 tempdirname = 'c:\temp' ;* This dir must have 'read/write' permissions 0011 OPENSEQ tempdirname:DIR_DELIM_CH:id TO outstream ELSE 0012 CREATE tempdirname:DIR_DELIM_CH:id ELSE NULL 0013 END 0014 LOOP 0015 numchars = SYSTEM(14) 0016 WHILE numchars DO 0017 INPUT line, numchars 0018 line := CHAR(13) ;* This line is only needed for Windows I think 0019 IF INDEX(line,"0.00",1) ELSE 0020 WRITESEQ line ON outstream ELSE NULL 0021 END 0022 REPEAT 0023 WEOFSEQ outstream ELSE NULL 0024 CLOSESEQ outstream 0025 0026 *---At this point we have the file saved as 'tempdirname:DIR_DELIM_CH:id' 0027 *---so we can do whatever we want with it. 0028 *---Typically you would EXECUTE some command against this file. 0029 *---For example, you could build up a command to email the file, or convert the file to PDF. 0030 0031 *---Finally remove the temporary file... 0032 OPEN tempdirname TO tempdir THEN DELETE tempdir, id I don't know if you would consider this 'integrated' but, given the tools you have at hand, it's the closest you are going to come to it. Dan On Sun, Sep 26, 2010 at 10:36 AM, Simon Verona <[email protected]>wrote: > Dan > > There seems to be an iphone app for everything else.... > > I can (and do) spool and process the file, just wondered it there was a > more "integrated" way of doing it! > > Regards > Simon > > On 26/09/2010 14:12, Daniel Klein wrote: > > There's no iphone app that will do that? ;-) > > Seriously, you would spool the report to a file and then post-process the > file. > > Dan > > > On Sun, Sep 26, 2010 at 7:00 AM, Simon Verona <[email protected]>wrote: > >> Hi all >> >> This may or may not be a stupid question. >> >> I have a transaction file, with many thousands of entries in, which should >> total zero both on a daily basis (there is a date field in the file) and >> overall. >> >> If I have a problem, then a check is to find which dates do not come back >> to zero... >> >> So, I execute a jQL query like : >> >> SORT TRANSACTIONS BY DATE BREAK-ON DATE "'VL'" TOTAL 2 (D) >> >> Which produces a list like : >> >> 02/07/2010 0.00 >> 01/07/2010 0.00 >> 30/06/2010 0.00 >> 29/06/2010 -585.31 >> 28/06/2010 0.00 >> 27/06/2010 0.00 >> etc etc >> >> All I want to see though is the dates that don't come to zero.... >> >> Can this be done using jQL? >> >> Thanks >> Simon >> >> -- >> Please read the posting guidelines at: >> http://groups.google.com/group/jBASE/web/Posting%20Guidelines >> >> IMPORTANT: Type T24: at the start of the subject line for questions >> specific to Globus/T24 >> >> To post, send email to [email protected] >> To unsubscribe, send email to [email protected] >> For more options, visit this group at >> http://groups.google.com/group/jBASE?hl=en >> > > -- > Please read the posting guidelines at: > http://groups.google.com/group/jBASE/web/Posting%20Guidelines > > IMPORTANT: Type T24: at the start of the subject line for questions > specific to Globus/T24 > > To post, send email to [email protected] > To unsubscribe, send email to [email protected] > For more options, visit this group at > http://groups.google.com/group/jBASE?hl=en > > > -- > Please read the posting guidelines at: > http://groups.google.com/group/jBASE/web/Posting%20Guidelines > > IMPORTANT: Type T24: at the start of the subject line for questions > specific to Globus/T24 > > To post, send email to [email protected] > To unsubscribe, send email to [email protected] > For more options, visit this group at > http://groups.google.com/group/jBASE?hl=en > -- Please read the posting guidelines at: http://groups.google.com/group/jBASE/web/Posting%20Guidelines IMPORTANT: Type T24: at the start of the subject line for questions specific to Globus/T24 To post, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
