|
Home > Archive > Getting Started with dBASE > January 2006 > Tutorial syntax error?
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 |
Tutorial syntax error?
|
|
| Cliff Beatty 2005-12-30, 3:23 am |
| When creating custom components, page 18 of the tutorial,(PBCANCEL),
I get the program alert error: Datatype mismatch. Expecting object. This is the code copied from the tutorial:
function PBCANCEL_onClick
if form.rowset.modified
if msgbox( "Abandon changes to this row?", "Abandon changes?", 36 ) == 6
form.rowset.abandon()
endif
else
form.rowset.abandon()
endif
return
I would appreciate someone telling me where the problem lies.
Thanks.
| |
| Michael Nuwer [dBVIPS] 2005-12-30, 7:23 am |
| Cliff Beatty wrote:
> When creating custom components, page 18 of the tutorial,(PBCANCEL),
I get the program alert error: Datatype mismatch. Expecting object. This is the code copied from the tutorial:
> function PBCANCEL_onClick
> if form.rowset.modified
> if msgbox( "Abandon changes to this row?", "Abandon changes?", 36 ) == 6
> form.rowset.abandon()
> endif
> else
> form.rowset.abandon()
> endif
> return
> I would appreciate someone telling me where the problem lies.
I am going to need more information. Are you using this button on a form
and getting the error message when you click the button? Does the error
message give you an exact line number for the error?
Generally the error message means that one of the object references in
the code are not correct for some reason. In the above code there are
two object references "form" and "form.rowset" If you are using this
button on a form then the form object is most likely ok. Does the form
also have a rowset in it? Is the "form.rowset = ....." property set?
If these comments do not help with the problem, please cut and paste all
the code in your form file into a message and I'll look at it.
Michael Nuwer
| |
| Cliff Beatty 2005-12-30, 11:23 am |
| Michael Nuwer [dBVIPS] Wrote:
> Cliff Beatty wrote:
>
> I am going to need more information. Are you using this button on a form
> and getting the error message when you click the button? Does the error
> message give you an exact line number for the error?
>
> Generally the error message means that one of the object references in
> the code are not correct for some reason. In the above code there are
> two object references "form" and "form.rowset" If you are using this
> button on a form then the form object is most likely ok. Does the form
> also have a rowset in it? Is the "form.rowset = ....." property set?
>
> If these comments do not help with the problem, please cut and paste all
> the code in your form file into a message and I'll look at it.
>
> Michael Nuwer
>This issue came up when I was creating "MyToolBar" in the custom components section of the tutorial, which I don't think would have a rowset. Am I correct in saying that this code would work if this tool bar was on a form that was linked to a table?
| |
| Michael Nuwer [dBVIPS] 2006-01-02, 8:23 pm |
| Cliff Beatty wrote:
>
>
Yes, that is the intended purpose of the toolbar. The code used in the
tutorial is simplified so it does not check to ensure that a rowset
object exists. The Databuttons that ship with dBASE Plus and the
toolbars and databuttons found in the dUFLP make this check so that the
buttons will not through the error when a rowset does not exist.
|
|
|
|
|