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 strongm 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
Dear All,

I need help. We Installed Red Hat Enterprise Linux 5 and the following Informix products:

Informix SE version 7.26 UC6R1
Informix 4gl Developer Version 7.32 UC4
Informix 4gl Runtime Version 7.32 UC4
Informix 4gl Compiler RT Version 7.32 UC3
Informix Sql Development Version 7.32 UC4
Informix Sql Runtime Version 7.32 UC4

We are compiling and executing alright but, it is failing to display some forms in the window or probably the cursor is not placed properly. Here is part program declaration and output from the executable:


---From Calling Main Module----------------

COMMAND KEY (A, a) "Amendemployee" "Amend Personal Details for Existing Employee"
CALL RqestEmployee() RETURNING w_manno ----This a call from the calling Module
IF w_manno != " "
THEN
CALL AmendEmplyDetails(w_manno)
END IF


-----Part Program ---------------
FUNCTION RqestEmployee() ------This is the function being called
DEFINE w_manno LIKE viewstaff.manno,
w_surname LIKE personnel.surname,
r_name LIKE personnel.surname,
r_forename LIKE personnel.other_names,
r_title LIKE personnel.title,
w_cnt SMALLINT

OPEN WINDOW win_request AT 5, 2
WITH 16 ROWS , 77 COLUMNS ATTRIBUTE (BORDER)

OPEN FORM RqestEmp FROM "/srs-prps/ppsys/phaseI/forms/RqestEmp" -----This is the form being display
DISPLAY FORM RqestEmp

LET int_flag = FALSE
LET w_manno = " "
LET w_surname = " "

LET GetInput = TRUE
WHILE GetInput
INPUT w_manno,
w_surname
WITHOUT DEFAULTS
FROM manno, -----Accepting input from the screen variable
surname

BEFORE FIELD manno
PROMPT " Select Either Man Number OR Surname - Press Return"
ATTRIBUTE(BOLD) FOR CHAR Answer

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
NEXT FIELD manno
END IF
END IF
END INPUT

-------.per form ---------------------------------------------------

DATABASE FORMONLY
SCREEN
{
Ref:RqestEmp




Man No.[f01 ] Surname [f02 ]


}
END
ATTRIBUTES
f01 = formonly.manno , REVERSE; -----The screen variable
f02 = formonly.surname, UPSHIFT,REVERSE;
END
INSTRUCTIONS
DELIMITERS " "


OUTPUT SCREEN

+-----------------------------------------------------------------------------+
|Transactions: Amend Insert Overtime eXit |
|Amend Payments & Deductions |
+-----------------------------------------------------------------------------+
| Ref:RqestEmp |
| |
| |
| |
| |
| Man No. Surname Segmentation fault
[ppsys@rhino bin]$ |
| | -- Window and Menu displayed
| |
| | -- Cursor should be in Mnno
| |
| | -- field but instead comes up
| | -- with Segmentation fault
| |
| |
| |
+-----------------------------------------------------------------------------+


Would anyone know why I am getting this segment fault ?

Your help is highly valued.

Thanking you in advance.


Regards



Felix Mwango Mutale
 

The first thing I would check is the two PROMPT statements within the INPUT statement. The INPUT statement is controlling input and then you are asking for input with PROMPTS. While correct syntax, this could be where your issue lies.

 
Hello Sir,

Thanks for the reply. The truth, the same syntax works very well on SCO UNIX 5.05 and Informix 4gl version 7.20. I did'nt really think there would be such major differences in the coding structure except probably the kernels with linux or #unclude which I am not aware of.

I still value your help. It is the only thing remaining and the system will be up and running.

Thanks and regards.


Felix Mwango Mutale
 
It seems like each Informix 4GL version has its own set of bugs and problems.

You might consider placing the two PROMPT statements in separate functions with their own window and then close the window when you return:

IF w_cnt != 1
THEN
CALL my_prompt()
.
.

Code:
# untested
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

You will probably have modify the ATTRIBUTE list to fit your own needs.


 
Hello All,

Does anyone in the group know the solution to the following:

INPUT statement in Informix Causes Segmentation fault ".

What should be done about it.


Thanks.


Felix Mwango Mutale
 
I think Olded is right.

Personnaly my compiler (7.5) does not accept prompt inside input statements unless prompt gots its end statement.

Code:
# untested of course 
 INPUT w_manno,                                
          w_surname
      WITHOUT DEFAULTS
     FROM manno,                                   -----Accepting input from the screen variable
          surname

    BEFORE  FIELD manno    
      PROMPT "      Select Either Man Number  OR Surname -  Press Return"
        ATTRIBUTE(BOLD) FOR CHAR Answer
      END PROMPT  -- here's a correction

    AFTER FIELD manno

I am not sure whether it will accept having "END PROMPT" just after the "PROMPT" line. In this case (and also for the user), you can add your Quit key treatment.

Anyway, having prompts inside inputs can be confusing for the end user..
 
Dear Sir,

Good Afternoon sir. I need help.

On UNIX environment we were printing on portrait and landscape with the following command line in Informix 4gl:

FUNCTION LandsPrint()
LET cmdline = " "
LET cmdline = "lpr -c -n ", copies clipped, " -d", printer clipped,
" -olandscape -otl66 -oc -ovsi5 -o nb -o 12 ", w_reportname
RUN cmdline
Prompt "Report is being sent to Printer - Press Return" FOR Answer
RETURN
END FUNCTION

FUNCTION LandsPrint2()
LET cmdline = " "
LET cmdline = "lpr -c -n ", copies clipped, " -d", printer clipped,
" -olandscape -otl43 -oc -ovsi8 -o nb ", w_reportname
RUN cmdline
Prompt "Report is being sent to Printer - Press Return" FOR Answer
RETURN
END FUNCTION

How could I print in Informix for CentOS Enterprise Linux ?

Thanking you in advance.


Felix Mwango Mutale
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top