Re: get_info function
Mike Aubury <[email protected]>
| Newsgroups | gmane.comp.lang.4gl.aubit.general |
|---|---|
| Message-ID | <CAGAq4WGN+vEa2OW3g3FgPaHVAW_tYMEmRjVK5WeTZLQfKwd7mA@mail.gmail.com> |
Yep - its broken - I think the "lines" were moved out the structure that
a4gl_get_info looks at - so they were removed from the call..
Unfortunately - it still thinks its returning a value - and thats causing
the dump..
FWIW - there are still a couple of problems with your 4gl anyway..
For "Windows"- theres no clobbering, and the function is called
"a4gl_get_info" - the aclfgl_ is automatically added - so it should look
like this :
let lv_mline=a4gl_get_info("Window","w1","MenuLine")
But - like I said - its bust anyway..
You can get close using by dropping into C and using another internal
function :
code
lv_mline=A4GL_get_option_value_for_current_window('M');
endcode
but - as the name implies - its only for the current window..
from the code, that 'char' parameter (not a "string"!) can be any of :
case 'C': return scr->comment_line; break;
case 'E': return scr->error_line ; break;
case 'F': return scr->form_line; break;
case 'M': return scr->menu_line ; break;
case 'm': return scr->message_line ; break;
case 'P': return scr->prompt_line ; break;
case 'A': return scr->acckey ; break;
case 'D': return scr->delkey ; break;
case 'I': return scr->inskey ; break;
case 'N': return scr->nextkey ; break;
case 'p': return scr->prevkey ; break;
case 'H': return scr->helpkey ; break;
case 'd': return scr->dispattr ; break;
case 'i': return scr->inpattr ; break;
case 'W': return scr->input_wrapmode ; break;
case 'f': return scr->fieldconstr ; break;
On 26 January 2012 17:42, Malcolm Perrior <[email protected]> wrote:
> Afternoon all
> I'm trying to use the "get_info" function because somewhere one of our
> programs seems to be losing its MENU LINE under Aubit and I'm trying to
> track down where this is happening.
> I tried calling "get_info" as per the manual but all I got was "undefined
> reference" when compiling.
> So on digging around libaubit4gl.so using "nm" I found
> aclfgl_a4gl_get_info; so, I then tried using that with the parameters
> specified in the manual (under "internal statements"). The code compiles
> now but I always seem to get a crash with "Window not found".
> Any help please?
> Thanks
> Malc
>
> Here's a basic 4GL that shows the problem (the file is called
> "getinfo_test.4gl", compiled with
> 4glpc -n getinfo_test.4gl -o getinfo_test)
>
> ### CODE ###
> main
>
> define lv_mline
> smallint
>
>
> open window w1 at
> 2,2
> with 10 rows, 50
> columns
> attributes (comment line last, menu line 1)
> current window is w1
>
>
> let lv_mline=aclfgl_a4gl_get_info("Window","getinfo_test:w1","MenuLine")
>
>
> display "Menu Line: ",lv_mline at 2,2
> attribute(green)
>
>
> sleep
> 3
>
>
> end main
> ### CODE ###
>
> It fails with:
> Assertion failed: internal stack corruption (File:stack.c
> Line:4150)
> Err:Program ./getinfo_test stopped at 'getinfo_test.4gl', line number
> 6.
> Error status number
> -30190.
> Window was not
> found.
>
>
> 4gl function call stack
> :
> MAIN
>
>
> Here's what looks like the relevant lines in debug.out:
>
> helper.c 764 dbg ( 0, 0,0) aclfgl_a4gl_get_info
> () Get info called with MenuLine getinfo_test:w1
> Window
> helper.c 708 dbg ( 0, 0,0) int_get_info
> () Looking for type
> Window
> helper.c 806 dbg ( 0, 0,0) A4GL_extract_numeral
> () Extracting numerals from
> Window
> helper.c 825 dbg ( 0, 0,0) A4GL_extract_numeral
> () Last
> non-numeric=5
> helper.c 832 dbg ( 0, 0,0) A4GL_extract_numeral
> ()
> Numeric=
>
> helper.c 844 dbg ( 0, 0,0) A4GL_extract_numeral
> () Setting number to
> 0
> helper.c 851 dbg ( 0, 0,0) A4GL_extract_numeral
> () Setting string to
> Window
> helper.c 221 dbg ( 0, 0,0) str_inarray
> () Digit =
> 0
> helper.c 245 dbg ( 0, 0,0) str_inarray
> () Checking Window
> Window
> helper.c 718 dbg ( 0, 0,0) int_get_info
> () Returns 1
> helper.c 621 dbg ( 0, 0,0) int_get_info_window
> () In get_info_window getinfo_test:w1
> MenuLine
> helper.c 627 dbg ( 0, 0,0) int_get_info_window
> ()
> P=(nil)
>
> helper.c 634 dbg ( 0, 0,0) int_get_info_window
> () Window was not found...
> getinfo_test:w1
> error.c 122 dbg ( 0, 0,0) A4GL_get_err_for_errstr
> () Looking for error desc for errmsg="Window was not
> found"
> error.c 129 dbg ( 0, 0,0) A4GL_get_err_for_errstr
> () Found error desc,
> a4gl_errno=190
> error.c 170 dbg ( 0, 0,0) A4GL_exitwith
> () Setting status, cache_status,
> cache_errmsg
> sql_common.c 297 dbg ( 0, 0,0) A4GL_set_status
> ()
> A4GL_set_status(-30190,0)
>
> sql_common.c 309 dbg (-30190, 0,1) A4GL_set_status
> () Status set to
> -30190
> mem.c 171 dbg (-30190, 0,1) acl_free_full
> () Free 0x9d946f0 helper.c
> 768
> mem.c 171 dbg (-30190, 0,1) acl_free_full
> () Free 0x9d94700 helper.c
> 769
> mem.c 171 dbg (-30190, 0,1) acl_free_full
> () Free 0x9d946e0 helper.c
> 770
> assert.c 18 dbg (-30190, 0,1) A4GL_assertion_failed
> () internal stack corruption (File:stack.c
> Line:4150)
>
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Aubit4gl-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>
>
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss