Project

General

Profile

Bug #2106

Missing runtime error messages in P2J

Added by Vadim Nebogatov about 11 years ago. Updated about 11 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/02/2013
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version:

History

#1 Updated by Vadim Nebogatov about 11 years ago

Moved from #2080, note 77
Example:

def var q11 as handle. 
def temp-table tt field ii as int. 
create tt. 
assign ii=4. 
define query q11 for tt. 
open query q11 for each tt. 
def var hQuery as handle. 
hQuery = query q11:handle. 

hQuery:REPOSITION-TO-ROW(1) NO-ERROR. 
MESSAGE "had error: " ERROR-STATUS:ERROR. 
MESSAGE "message 1: " ERROR-STATUS:GET-MESSAGE(1).

4GL had error: no
4GL Messages:
Cannot reposition on query q11 which is not defined as SCROLLING. (3164) 

P2J had error: no

P2J Messages: no messages

#2 Updated by Vadim Nebogatov about 11 years ago

Moved from #2080, note 78

Example:

CONNECT vtest NO-ERROR. 
MESSAGE "had error: " ERROR-STATUS:ERROR. 
MESSAGE "message: " ERROR-STATUS:GET-MESSAGE(1). 

4GL had error: no
4GL Messages:
** Warning -- database vtest is already connected. (1012) 

P2J: not tested so far

#3 Updated by Vadim Nebogatov about 11 years ago

Moved from #2080, note 74

Example:

def temp-table tt field ii as int.
DEFINE QUERY custq FOR tt.
DEFINE BROWSE custb QUERY custq  DISPLAY ii WITH 10 DOWN MULTIPLE.
DEFINE FRAME brs-frame custb.
custb:FETCH-SELECTED-ROW(5)  NO-ERROR.
MESSAGE "ERROR-STATUS:ERROR =" ERROR-STATUS:ERROR ", ERROR-STATUS:NUM-MESSAGES =" ERROR-STATUS:NUM-MESSAGES.
MESSAGE "message 1: " ERROR-STATUS:GET-MESSAGE(1).
MESSAGE "message 2: " ERROR-STATUS:GET-MESSAGE(2).

4GL messages:
ERROR-STATUS:ERROR = no , ERROR-STATUS:NUM-MESSAGES = 1
message 1:  Browse widget must contain at least one record before FETCH-SELECTED-ROW 
method is used. (2108)
message 2: 

Runtime error:

java.lang.IndexOutOfBoundsException: Invalid selected row index requested: 4. Only 0 rows are present.
com.goldencode.p2j.ui.client.Browse.getSelectedRowIndex(Browse.java:1143)
com.goldencode.p2j.ui.BrowseConfig.getSelectedRowIndex(BrowseConfig.java:464)
com.goldencode.p2j.ui.chui.ThinClient.getSelectedRowIndex(ThinClient.java:5401)

#4 Updated by Vadim Nebogatov about 11 years ago

Moved from #2080, note 74

Example:

DEFINE VARIABLE i AS INTEGER.
DEFINE BUTTON btn-Display LABEL "Display".
DEFINE BUTTON btn-quit LABEL "&Quit" AUTO-ENDKEY.
def temp-table test no-undo
    field tot-hrs   as int
    field proj-mgr  as int
    field yes_no    as logical
    index pi_hrs is primary tot-hrs ascending.

create test.
assign tot-hrs    = 50 proj-mgr   = 1 yes_no     = yes.

create test.
assign tot-hrs    = 10 proj-mgr   = 1 yes_no     = no.

create test.
assign tot-hrs    = 43 proj-mgr   = 2 yes_no     = true.

create test.
assign tot-hrs    = 11 proj-mgr   = 3 yes_no     = true.

create test.
assign tot-hrs    = 31 proj-mgr   = 0 yes_no     = false.

create test.
assign tot-hrs    = 45 proj-mgr   = 3 yes_no     = true.

def query q for test.
def browse brws query q no-lock no-wait
    display test
    enable yes_no auto-return
    with single 5 down centered no-row-markers.

open query q
    for each test no-lock.

DEFINE FRAME f-frame brws btn-display btn-quit WITH SIZE 80 BY 22.

find last test.

reposition q to recid recid(test).

/* Process Display button */
ON CHOOSE OF btn-display DO:
 message "aaa = " brws:NUM-SELECTED-ROWS.
/* set up loop */
DO i = 1 TO brws:NUM-SELECTED-ROWS:

/* Get each selected row from browse */
brws:FETCH-SELECTED-ROW(i).

/* Display columns 1 & 2 in a message box */
END.

END.
ON CHOOSE OF btn-quit DO:
QUIT.
END.
enable all with frame f-frame.

wait-for close of current-window.

It works in 4GL including FETCH-SELECTED-ROW, but gives exception with converted code:

com.goldencode.p2j.util.EndConditionException: END-ERROR key function

com.goldencode.p2j.ui.chui.ThinClient.processCondition(ThinClient.java:13629) com.goldencode.p2j.ui.chui.ThinClient.processProgressEvent(ThinClient.java:13160) com.goldencode.p2j.ui.chui.ThinClient.processEventsWorker(ThinClient.java:12431) com.goldencode.p2j.ui.chui.ThinClient.pop(ThinClient.java:11253) com.goldencode.p2j.ui.chui.ThinClient.eventBracket(ThinClient.java:11236) com.goldencode.p2j.ui.chui.ThinClient.eventDrawingBracket(ThinClient.java:11162) com.goldencode.p2j.ui.chui.ThinClient.applyWorker(ThinClient.java:10933) com.goldencode.p2j.ui.chui.ThinClient.waitForWorker(ThinClient.java:9046) 

Also available in: Atom PDF