Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PB 5, XP, Printjob now hangs

Status
Not open for further replies.

computergeek

Programmer
May 23, 2001
193
CA
Hi,

I have been tasked with taking a look at one our our legacy systems that still uses PB 5.0, on XP. Script now hangs after upgrading to XP:

int li_Job
window lw_Sheet

/* Print active sheet */
lw_Sheet = w_mdi_main.GetActiveSheet ()
if IsValid (lw_Sheet) then
w_mdi_main.SetMicroHelp ("Printing active sheet...")
li_Job = PrintOpen ()
lw_Sheet.Print (li_Job, 1, 1)
PrintClose (li_Job)
w_mdi_main.SetMicroHelp ("")
end if

Any ideas as to why? (Other than this application SHOULD be upgraded to a newer version of PB)

Thanks in advance for the information.

Computergeek
 
I'd check the return value from the printopen method call. You may have to change the variable "li_Job" to a long from an integer.

Matt

"Nature forges everything on the anvil of time
 
Hi,

I don't think the method PrinttoPen method exists within PB 5.0 What is the PrinttoPen method?

Thanks,

Computergeek
 
Hi,

Duh... sorry for the last reply. I think I better go have my morning coffee.

Computergeek
 
Your example is using the following:

li_Job = PrintOpen ()

the value returned may exceed the limit of a Powerbuilder integer thereby setting li_Job to some random value.

Matt

"Nature forges everything on the anvil of time
 
Hi,

Thanks... Changed the li_job fro Int to Long and it works now. Not sure why this functionality worked fine though for about 10 years other than the OS changed.

Thanks again,

Computergeek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top