Home > Archive > Programming with dBASE > February 2006 > Close procedure problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Close procedure problem
Mike Nunn

2006-02-18, 9:23 am

This relates to the thread 'Centering Choose Printer Form' last December.
The problem was to centre the print dialogue in the _App.FrameWin
irrespective of the state of the form calling the procedure.

Rick Miller came to the rescue, and I have finally got down to adapting his
suggestions in an application.

It works OK, except that when the application attempts to close the
procedure I get a message that it can't find a procedure to close. 'UDF or
Procedure not found'.

The code is below - I hope someone will be able to tell me what I am doing
wrong.

Mike

Code from routine calling the procedure:

set procedure to PrintLink.wfm additive
Local bret, oForm
oForm = new PrintLinkForm()
oForm.mdi := false
oForm.readModal()
bRet = iif(oForm. retvalue,true,false)

oForm.release()
oForm := null
If bRet

//report printed - this works

Endif
close procedure PrintLink.wfm //this is where the error message
pops up

//This is the procedure called


** END HEADER -- do not remove this line
//
// Generated on 18/02/2006
//
parameter bModal
local f
f = new PrintLinkForm()
if (bModal)
f.mdi = false // ensure not MDI
f.readModal()
else
f.open()
endif

class PrintLinkForm of FORM
with (this)
onOpen = class::FORM_ONOPEN
readModal = class::FORM_READMODA
L
metric = 6
visible = false
autocenter = true
height = 10
left = 80
top = 0
width = 10
text = ""
endwith

this.PUSHBUTTON1 = new PUSHBUTTON(this)
with (this.PUSHBUTTON1)
onClick = class::PUSHBUTTON1_O
NCLICK
height = 24
left = 2
top = 1
width = 60
text = "OK"
endwith

function form_readModal
this.hwndParent := int(_app.framewin.hwnd)
this.showtaskbarbutton := false
return form::readModal()

function form_onOpen
form. pushbutton1_onClick(
)
return

function PUSHBUTTON1_onClick
form.retvalue = chooseprinter()
form.close()
return

endclass






Todd Kreuter

2006-02-18, 11:23 am

Mike Nunn wrote:
>
> It works OK, except that when the application attempts to close the
> procedure I get a message that it can't find a procedure to close. 'UDF or
> Procedure not found'.


I don't see anything causing the procedure to close. Is the direcotry
changed during the print process? If you open a procedure file, change
directory with set directory and try to close that procedure file, you
will get an error.

Most people would not even bother closing the procedure. You may want to
just wrap the close procedure in try/endtry and forget about it ;-)

--
Todd Kreuter [dBVIPS]
Mike Nunn

2006-02-18, 11:23 am

Todd Kreuter wrote:

'I don't see anything causing the procedure to close.'

Quick reply - thank you.

No, there is no directory change.

I will follow your tip.

Mike


"Todd Kreuter" <tkreuter@dbvips.usa> wrote in message
news:43F741E5.65831F98@dbvips.usa...
> Mike Nunn wrote:
>
> I don't see anything causing the procedure to close. Is the direcotry
> changed during the print process? If you open a procedure file, change
> directory with set directory and try to close that procedure file, you
> will get an error.
>
> Most people would not even bother closing the procedure. You may want to
> just wrap the close procedure in try/endtry and forget about it ;-)
>
> --
> Todd Kreuter [dBVIPS]



John York

2006-02-19, 9:23 am

sort of a known issue but not all the circumstances that cause it

Make the following change and see if it doesn't solve the problem

> Code from routine calling the procedure:
>
> set procedure to PrintLink.wfm additive
> Local bret, oForm
> oForm = new PrintLinkForm()
> oForm.mdi := false


close procedure printlink.wfm && move the close to here

> oForm.readModal()
> bRet = iif(oForm. retvalue,true,false)

> oForm.release()
> oForm := null
> If bRet
>


John




"Mike Nunn" <mbnunnuk@yahoo.co.uk> wrote in message
news:vAcrb6JNGHA.1152@news-server...
> This relates to the thread 'Centering Choose Printer Form' last December.
> The problem was to centre the print dialogue in the _App.FrameWin
> irrespective of the state of the form calling the procedure.



Mike Nunn

2006-02-20, 1:23 pm

Thanks John.

I will try next time I revisit the routines affected. Meanwhile, I followed
Todd Kreuter's advice and put in a Try statement, which has kept things
quiet.

Mike




"John York" < johnatbritesidedotne
t> wrote in message
news:ZBYQewVNGHA.1740@news-server...
> sort of a known issue but not all the circumstances that cause it
>
> Make the following change and see if it doesn't solve the problem
>
>
> close procedure printlink.wfm && move the close to here
>
>
> John
>
>
>
>
> "Mike Nunn" <mbnunnuk@yahoo.co.uk> wrote in message
> news:vAcrb6JNGHA.1152@news-server...
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com