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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Parameter Error 1

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,826
JP
Hi all,
I have an odd issue I can't seem to sort out.
I've been updating my forms in my app to be more modern, and I've adopted some things you have all suggested, like goAPP.
I have as the form basis a form class called LargeFormBase, which then is used for CodeTableForm and SuperLargeFormBase.
When I run a form in the App (like a code table), it works fine, but when I run one that is in the SuperLargeForm, during the INIT I get an error that states:
No PARAMETER state ment is found.

That occurs on the call: ThisForm.ShowTips = goAPP.glTipState

This same init code is in the LargeFormBase. There is no change in code in the code table or super large forms, yet the code table runs, and the SuperLarge form doesn't. (They both inherit their INIT from the LargeFormBase class.)

I stepped through the code, but it looks identical between the two forms, so I am confused why it's asking for a PARAMETER statement in one form, and not in the other? I'm kind of stuck, any ideas?


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
The only way a line setting a property can lead to a missing parameter statement is, there is a property_assign method and so setting the property indirectly triggers a call to that method. When you use the properties editor to add an assign method, code is put in automatically, which does set the property, if you manually added a method like ShowTips_Assign, and have no PARAMETERS lvNewValue line in there, then that causes such an error.

Aferthought: That wouldn't differ in IDE vs running embedded in an EXE, though. No idea.

Establish an error handler calling ASTACKINFO and storing all the array info to an error log, to not only see what executed last, but also from where that was called. Then compile with debuginfo to let ASTACKINFO work correctly and you most probably will know much better what triggers the error.

Bye, Olaf.
 
Hi Olaf,
Wasn't aware of that, but also, I haven't done what you describe. And the forms all have the same base form class, there is no change from code in between.
I'm still bewildered. The other forms work, and this one form gives this error.
Any other possibilities?


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Well, the error "No Parameter" always occurs in the first line of anything, when it was called with parameters. It's not addressing that lines, it's addressing the missing of PARAMETERS caused by some call (or CREATEOBJECT in case o INIT) passing in a parameter.

For example remove the LPARAMETERS from what I just posted in thread184-1781449:
Code:
? f(1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7)

FUNCTION f()
    *LPARAMETERS a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
    ? ab
    RETURN PCOUNT()

That will error and point to the line ?ab. What really causes the error is the call of f() with parameters, while it doesn't have a parameters (or lparameters) line now, as it's commented out.

In case of that error happening in Init you have a NEWOBJECT() or CREATEOBJECT() somewhere else causing that propblem by passing in parameters.

If you inherited an INIT and overwrote the PARAMETERS or didn't make it the first line in your code, you've broken the init. Notice, when you write a form class having Init parameters and then inherit that, the Init procedure of the new child class will show that (L)PARAMETERS line from its parent class, this has to stay, or you remove the ability to call that child class with parameters.

Again, that doesn't explain why it works in EXE and not in the IDE, but use ASTACKINFO as suggested above (reread my earlier post, I edited it before I saw your answer) to find out where that really comes from.

Bye, Olaf.
 
Ah, thanks Olaf. I see the point, and now I see that the button that calls the form in this case is trying to pass some positioning parameters of the form along with it, so it is that "DO FORM <Form> WITH..." that is causing the issue.

Will try to keep this lesson in the forefront.
Cheers.

Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Thanks, Scott.

I think I also had the flash of insight now, which made the form work in some cases: If you simply tested the SCX by running it with the [!] run button, you surely did without specifying parameters and that causes no problem.

This error is "unfair" in a way. You call something not accepting parameters with parameters or you call something accepting parameters with too many parameters, and the error handler blames the called form init/method/function/procedure and not the caller. Funny how this topic overalapped with the other thread.

As defense one might simply put in parameter statements with 26 parameters into everything, that prevents that error, but generates 26 variables you most often don't need, also it would be cumbersome and with PARAMETERS generating private variables that also might cause side effects in further calls, so LPARAMETERS is recommended. By the way: PCOUNT( would always tell you how many parameters were really passed in, so it's possible to go that route, but not wise. It introduces more questions than it solves problem cases.

Bye, Olaf.

 
Olaf,
Yeah the error is "unfair". But I don't run forms for testing using ! for exactly that reason... they don't always show what will happen in a runtime environment, so I test with DO <project.exe> within the IDE instead, which also has a few quirks compared to runtime only .EXE environment. But yeah, I understand now why it happens this way, I just hope that when it happens again 2 years from now, I remember this is what the issue is. ><


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top