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

Segmentation fault

Status
Not open for further replies.

fmmutale

MIS
Oct 13, 2008
12
NG
Hello Sir,

Thank you so much for the response. Your response has given me the drive to move.

I did effect the suggestions you made and tried to trace from the Calling program as follows:

COMMAND KEY (A, a) "Amend" "Amend Payments & Deductions"
CALL RqestEmployee() RETURNING w_manno
IF w_manno != " "
THEN
CALL AmendPaymentDeduction(w_manno)
END IF


display " Inside infield manno 1 "
sleep 5
LET GetInput = TRUE
WHILE GetInput
INPUT w_manno,
w_surname
WITHOUT DEFAULTS
FROM manno,
surname

display " Inside infield manno 1 "
sleep 5
ON KEY (CONTROL-B)
IF INFIELD(surname)
THEN
LET StringSearch = FALSE
LET PartEntry = get_fldbuf(surname)
CALL Help_Surname(15, 19) RETURNING w_surname
DISPLAY w_surname TO surname
END IF

AFTER FIELD manno
IF w_manno <> " "
AND w_manno IS NOT NULL
THEN
SELECT COUNT(*)
INTO w_cnt
FROM personnel per,
payrollstatus prs
WHERE per.manno = prs.manno
AND prs.manno = w_manno

{IF w_cnt != 1
THEN
PROMPT "No Personnel Record Exists With This Man Number ",
" - Press Return"
ATTRIBUTE(BOLD) FOR CHAR Answer---}
IF w_cnt != 1
THEN
CALL my_prompt()
NEXT FIELD manno
END IF
END IF
END INPUT

FUNCTION my_prompt()
DEFINE answer CHAR(1)

OPEN WINDOW m_wsu AT 4,6 WITH FORM "my_wsu"
ATTRIBUTE(BORDER,FORM LINE 2, COMMENT LINE LAST-1,PROMPT LINE LAST,MESSAGE LINE LAST)

PROMPT "No Personnel Record Exists With This Man Number ", " - Press Return" FOR CHAR answer
CLOSE WINDOW m_wsu

END FUNCTION


From the look of things, it is like, the "ON KEY (CONTROL-B" is not being recognised. What can I use instead ?

Thanking you once again.

Regards


Felix Mwango Mutale
 
What is the problem? Do you still have a segmentation fault? Or is the control-b key combination being ignored?

First, if you want the user to be able to execute control-b in the INPUT statement, the ON KEY clause is required. There is nothing else to use.

For a segmentation fault, you have to start commenting out things until you figure out what the problem is before you can fix it. (I alrady told you about using prompt an input statement).

If the control-b is being ignored, then you have a terminal emulation problem, and we can start talking about what terminal you are using, and what values you are using for TERM, INFORMIXTERM, etc.
 
Hello Sir,

Thanks for the reply. I have tried to put displays around to track down the flow as follows:

LET GetInput = TRUE
WHILE GetInput
display " Inside infield manno 1 "
display "GetInput = ", GetInput
sleep 5
INPUT w_manno,
w_surname
WITHOUT DEFAULTS
FROM manno,
surname

AFTER FIELD manno
display " Inside infield manno 2 "
sleep 5
IF w_manno <> " "
AND w_manno IS NOT NULL
THEN
SELECT COUNT(*)
INTO w_cnt

The second display is not coming. I can't put a display just after the INPUT command or as I am getting a syntax error.

I have also tried the following:

LET GetInput = TRUE
WHILE GetInput
display " Inside infield manno 1 "
display "GetInput = ", GetInput
sleep 5
INPUT BY NAME manno,
surname
WITHOUT DEFAULTS

But still I don't seem to get what is going on.

Thanking you in advance.


Felix Mwango Mutale
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top