Author | Topic: Multi-Page Text File Problem - Topdown | |
---|---|---|
Scott Krise | Multi-Page Text File Problem - Topdown on Fri, 11 Mar 2016 08:17:56 -0500 Hello All, I am converting my software from a hybrid textual/GUI system to a full GUI system. I am running the same programs in both systems, but I have a bug when doing it the GUI version only. The other works fine. The error occurs when I send a multiple page document to a text file. I use the topdown print previewer for this purpose. The bombout occurs when the NEWPAGE method is called. It errors out on the qqout(chr(12)) line below. It seems like I don't have the same character set available in my two systems possibly...but I can't see what needs to change. Does anyone have any thoughts? The error I get is "Access to method not allowed in this context". Thanks, Scott METHOD tdcPrn4:newpage() IF ::lAscii qqout(chr(12)) ::nPage ++ setprc(0,0) ELSE ::xbpPrinter:newPage() ::nPage ++ ::setQprc(0,0) ******* PDF ::Pdfadd(::aPDFset,::aPDFpage) add current page array to set ::aPDFpage := {} begin new blank page array ::PdfAdd(::aPDFpage,{"NewPage"}) add newpage command to new page array ENDIF | |
Andreas Gehrs-Pahl | Re: Multi-Page Text File Problem - Topdown on Mon, 14 Mar 2016 12:40:28 -0400 Scott, >The error occurs when I send a multiple page document to a text file. I use >the topdown print previewer for this purpose. The bombout occurs when the >NEWPAGE method is called. It errors out on the qqout(chr(12)) line below. It >seems like I don't have the same character set available in my two systems >possibly...but I can't see what needs to change. Does anyone have any >thoughts? The reason for the runtime error is actually that SetAppWindow() doesn't return a valid XbpCRT() dialog when the QQOut() function is executed. >The error I get is "Access to method not allowed in this context". A complete error log would be more helpful than just a generic error message. I assume that the actual Sub-System Error Code is: 4402 (with error message: "Method is not allowed for an Object of this Class") and that the Set Console setting is On, but those are just educated guesses. To fix this, make either sure that your SetAppWindow() is set to return a (valid) XbpCRT() dialog, before calling any console output functions, such as QOut() and QQOut(), or use Set Console Off to disable screen output for such functions. As you are also using SetPrc(0,0) in your code, I also assume that you use @ Say (or more precisely DevOut()) to print text to the printer, redirecting the output with Set Device to Printer. Basically, Set Device affects the DevPos()/DevOut() etc., while Set Console affects QOut()/QQOut(). Alternatively, you could remove the QQOut(chr(12)) line completely, and replace it with the EJECT command (or directly with the _Eject() function). I recommend to RTFM, specifically the following topics: EJECT, Set Printer, Set Device, and Set Console, for more details on which areas those settings affect. Hope that helps, Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas@AbsoluteSoftwareLLC.com web: http://www.AbsoluteSoftwareLLC.com | |
Scott Krise | Re: Multi-Page Text File Problem - Topdown on Wed, 16 Mar 2016 09:03:57 -0400 Thank you Andreas! Turning Console Off eliminated my error. As I said before, I was converting from a textual system to a GUI system, and the console was something I simply omitted in the GUI version. I did some additional troubleshooting since my initial post, and I actually had suspected it had something to do with the fact that a CRT was created in my textual system, not not in my GUI system...but I still didn't know what to do to fix it. You were correct, by the way, about the error code too. It was 4402 like you had suspected. Thanks again for the help! "Andreas Gehrs-Pahl" wrote in message news:1kzxpscnxbm3w$.onstuqz5wvcc.dlg@40tude.net... > Scott, > >>The error occurs when I send a multiple page document to a text file. I >>use >>the topdown print previewer for this purpose. The bombout occurs when the >>NEWPAGE method is called. It errors out on the qqout(chr(12)) line below. >>It >>seems like I don't have the same character set available in my two systems >>possibly...but I can't see what needs to change. Does anyone have any >>thoughts? > > The reason for the runtime error is actually that SetAppWindow() doesn't > return a valid XbpCRT() dialog when the QQOut() function is executed. > >>The error I get is "Access to method not allowed in this context". > > A complete error log would be more helpful than just a generic error > message. I assume that the actual Sub-System Error Code is: 4402 (with > error > message: "Method is not allowed for an Object of this Class") and that the > Set Console setting is On, but those are just educated guesses. > > To fix this, make either sure that your SetAppWindow() is set to return a > (valid) XbpCRT() dialog, before calling any console output functions, such > as QOut() and QQOut(), or use Set Console Off to disable screen output for > such functions. > > As you are also using SetPrc(0,0) in your code, I also assume that you use > @ Say (or more precisely DevOut()) to print text to the printer, > redirecting > the output with Set Device to Printer. Basically, Set Device affects the > DevPos()/DevOut() etc., while Set Console affects QOut()/QQOut(). > > Alternatively, you could remove the QQOut(chr(12)) line completely, and > replace it with the EJECT command (or directly with the _Eject() > function). > > I recommend to RTFM, specifically the following topics: EJECT, Set > Printer, > Set Device, and Set Console, for more details on which areas those > settings > affect. > > Hope that helps, > > Andreas > -- > Andreas Gehrs-Pahl > Absolute Software, LLC > > phone: (989) 723-9927 > email: Andreas@AbsoluteSoftwareLLC.com > web: http://www.AbsoluteSoftwareLLC.com |