>I would like to be able to write some notes regarding a form that imports data. Specifically I would like to create a 'zreadme' method and be able to display the contents of the zreadme method if a user clicks on a 'Help' button. The zreadme method would have the details surrounded by TEXT ... ENDTEXT. I do not want to create a seperate table with a memo field to show the help notes.
>
>Can I do something like this?
Tom, sure you can.
I don't know where do you want to display the help text, let's make it in the pop-up editbox
You place editbox say, edtComment on the form, set
edtComment.Visible = .f.,
edtComment.ReadOnly = .t.
In your Form.zreadme() method you place
TEXT
My helptext is about....
....
and it ends here.
ENDTEXT
In your HelpButton.Click() you place the following code:
lcText = thisform.ReadMethod("zreadme")
lcNote = CHR(38)+CHR(38)
lcText = strtran(lcText, "ENDTEXT"+lcNote, "")
lcText = strtran(lcText, "TEXT"+lcNote, "")
lcText = alltrim(lcText)
DO WHILE LEFT(lcText, 1) = CHR(13) OR LEFT(lcText, 1) = CHR(10)
lcText = RIGHT(lcText,len(lcText)-1)
ENDDO
thisform.edtComment.value = lcText
thisform.edtComment.Visible = .t.
thisform.edtComment.ZOrder(0)
thisform.edtComment.SetFocus()
In edtComment.KeyPress()
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 27
this.Visible = .F.
this.ZOrder(1)
ENDIF
In edtComment.LostFocus()
you may put
this.KeyPress(27)
to get rid of editbox if you clicked on something else.
You can take this as a sample and elaborate on the functionality if you want.
HTH,
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison