Page 1 of 1

Long procedure names in user objects

Posted: Fri Sep 12, 2014 3:32 am
by ErikG
Hi,

Is there a maximum length for the name (or the .prg filename) for user defined procedures in user defined objects? - If this is the case, could you make sure that Eviews gives the author some kind of warning? I may be mistaken but it appears that Eviews simply ignores calls to procedures that have a rather long, but not unreasonably long, name.

I put together an example for you:

The .ini file:

Code: Select all

[constructor] ".\TestObject construct.prg" [views] [procs] "testlong", ARatherLongProcedureName, ".\ARatherLongProcedureName.prg" "testshort", ShortName, ".\ShortName.prg"
The long and short procedures only contain @uiprompt() lines. The constructor is just an empty .prg file.

When I use these procedures only the shortname procedure seems to work, the long one is silent. There is no error message, it simply skips the long procedure, while the short procedure produces the intented @uiprompt() message.

Code: Select all

WfCreate(wf=attempt, page=mypage) u 1 TestObject Ob ob.ARatherLongProcedureName ob.ShortName

Re: Long procedure names in user objects

Posted: Fri Sep 12, 2014 3:44 am
by ErikG
I should mention that calling the long procedure with the interactive user interface - the procedure meny in the object - works fine, but calling the procedure by running the .prg file as shown above does not.

Re: Long procedure names in user objects

Posted: Fri Sep 12, 2014 8:16 am
by EViews Gareth
I can't replicate this (using the same constructor that you did).

Re: Long procedure names in user objects

Posted: Mon Sep 15, 2014 12:42 am
by ErikG
Strange, perhaps it's a network thing, none of my files are on a local computer.
The character limit seems to be 16, i.e 2 bytes right?
Could you try this with any object:

Code: Select all

WfCreate(wf=attempt, page=mypage) u 1 TestObject Ob ob.ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ ob.XXXXXXXXXXXXXXXXXXXXXXXXXX ob.HHHHHHHHHHHHHHHHH ob.TTTTTTTTTTTTTTTT
None of these procedures actually exist, but my error message doesn't come until the TTTTTT procedure.

Re: Long procedure names in user objects

Posted: Mon Sep 15, 2014 7:58 am
by EViews Gareth
Ah, yep, I can see some weirdness going on there. I've checked in some code that should make it better. Should be available next patch.