Need help with DISPLAY ARRAY problem 
Author Message
 Need help with DISPLAY ARRAY problem

Hi,

        I need some help.  I am new to Informix - so new I am using
Informix 4GL 1.10.  I am learning this using the Users Guide but applying
it to my own application.  I am having the following problem:

        OPEN FROM fba_stats FROM "fba_stats"
        DISPLAY FORM fba_stats

        DISPLAY ARRAY p_player TO player.*

The above syntax is right from the guide.  But nothing displays in the
form fields.  The form displays but no info.  I have verified that there
is valid data in all the record fields of p_player.  I did this by displaying
all the values of p_player right before the DISPLAY ARRAY statement.

The record layout of the screen array, player, is the same as the program
array, p_player which they need to be.  Can anyone help?

Also, while debugging the C code of this prog, I noticed that after certain
statements, a variable "status" is checked.  I am assuming this is the
return status value of the just executed Informix statement.  First, is that
a true statement and 2nd is there any way in a 4GL program to check the
status of an executed statement i.e. the DISPLAY ARRAY statement.

Thanks for any help.




Sun, 09 Jun 1996 23:48:03 GMT
 Need help with DISPLAY ARRAY problem

Quote:
}Date: Wed, 22 Dec 93 7:25:48 PST

}Subject: Need help with DISPLAY ARRAY problem
}X-Informix-List-Id: <list.3255>
}       I need some help.  I am new to Informix - so new I am using
}Informix 4GL 1.10.  I am learning this using the Users Guide but applying
}it to my own application.  I am having the following problem:
}
}       OPEN FROM fba_stats FROM "fba_stats"

        OPEN FORM fba_stats FROM "fba_stats"

Quote:
}       DISPLAY FORM fba_stats
}
}       DISPLAY ARRAY p_player TO player.*
}
}The above syntax is right from the guide.

Oh no it isn't.

Quote:
}But nothing displays in the form fields.  The form displays but no info.
}I have verified that there is valid data in all the record fields of
}p_player.  I did this by displaying all the values of p_player right
}before the DISPLAY ARRAY statement.

You didn't tell it how many initialised rows there are in the array, so it
is assuming zero.

        CALL SET_COUNT(1)

Or choose some other larger number.

Quote:
}Also, while debugging the C code of this prog, I noticed that after certain
}statements, a variable "status" is checked.  I am assuming this is the
}return status value of the just executed Informix statement.  First, is that
}a true statement

Correct.

Quote:
}and 2nd is there any way in a 4GL program to check the
}status of an executed statement i.e. the DISPLAY ARRAY statement.

RTFM: WHENEVER ERROR ...

Yours,



Mon, 10 Jun 1996 01:08:04 GMT
 Need help with DISPLAY ARRAY problem
->Subject: Need help with DISPLAY ARRAY problem

->Date: Wed, 22 Dec 93 7:25:48 PST

->
->Hi,
->
->   I need some help.  I am new to Informix - so new I am using
->Informix 4GL 1.10.  I am learning this using the Users Guide but applying
->it to my own application.  I am having the following problem:
->
->   OPEN FROM fba_stats FROM "fba_stats"
->   DISPLAY FORM fba_stats
->
->   DISPLAY ARRAY p_player TO player.*
->
->The above syntax is right from the guide.  But nothing displays in the
->form fields.  The form displays but no info.  I have verified that there
->is valid data in all the record fields of p_player.  I did this by displaying
->all the values of p_player right before the DISPLAY ARRAY statement.
->
->The record layout of the screen array, player, is the same as the program
->array, p_player which they need to be.  Can anyone help?
->
->Also, while debugging the C code of this prog, I noticed that after certain
->statements, a variable "status" is checked.  I am assuming this is the
->return status value of the just executed Informix statement.  First, is that
->a true statement and 2nd is there any way in a 4GL program to check the
->status of an executed statement i.e. the DISPLAY ARRAY statement.
->
->Thanks for any help.
->

Good morning, John,

Before you do a DISPLAY ARRAY, you must call the Informix supplied function
SET_COUNT() to tell Informix how many rows are in the array.  Look for a
section "4GL Function Library" in your 4GL Reference, probably volume 1.

STATUS is a global variable available to your 4GL program.  To fully use it,
you must state WHENEVER ERROR CONTINUE before running the SQL statement(s).  
Otherwise, Informix will trap your errors for you and abort the program upon
an abnormal condition.  Look up WHENEVER ERROR {STOP|CONTINUE} in your ref.
manual for more info.  Also look up SQLCA.SQLCODE, which is the other way
of getting STATUS information.  STATUS and SQLCA.SQLCODE come in three
flavors: =0 means success, =100 (or global variable NOTFOUND) means no data
found or end of data for a cursor, <0 means an error.  (All error conditions
have negative values.)

I have used I4GL 2.10/4.00/4.10, so some of this may not apply to 1.10;
however, it is pretty basic stuff and was probably in there from the start.

If you have more questions, give me a call.

Regards,
Alan                   ___________________________
______________________| R. Alan Popiel            |__________________________
\  Internet:          | Martin Marietta, SLS      |                         /

  )Voice:             | Denver, CO 80201-0179 USA |                       (
 /   303-977-9998     |___________________________|  (But you knew that!)  \
/________________________)                     (____________________________\



Mon, 10 Jun 1996 00:18:02 GMT
 Need help with DISPLAY ARRAY problem
From John O'Sullivan:
*
*
*
* Hi,
*
*       I need some help.  I am new to Informix - so new I am using
* Informix 4GL 1.10.  I am learning this using the Users Guide but applying
* it to my own application.  I am having the following problem:
*
*       OPEN FROM fba_stats FROM "fba_stats"
*       DISPLAY FORM fba_stats
*
*       DISPLAY ARRAY p_player TO player.*
*
* The above syntax is right from the guide.  But nothing displays in the
* form fields.  The form displays but no info.  I have verified that there
* is valid data in all the record fields of p_player.  I did this by displaying
* all the values of p_player right before the DISPLAY ARRAY statement.
*
* The record layout of the screen array, player, is the same as the program
* array, p_player which they need to be.  Can anyone help?
*
* Also, while debugging the C code of this prog, I noticed that after certain
* statements, a variable "status" is checked.  I am assuming this is the
* return status value of the just executed Informix statement.  First, is that
* a true statement and 2nd is there any way in a 4GL program to check the
* status of an executed statement i.e. the DISPLAY ARRAY statement.

You need to tell informix how many lines are in the array by using the
SET_COUNT( # ) function. Change your code to the following:

        DEFINE num_rows         SMALLINT

        OPEN FROM fba_stats FROM "fba_stats"
        DISPLAY FORM fba_stats

        LET num_rows = ?  # Replace the ? with number of rows in array

        CALL SET_COUNT(num_rows)
        DISPLAY ARRAY p_player TO player.*

         Robert Minter             |Data Systems Support|         \\\_///
Programmer, Software Development   |     Orange, CA     |         ( _ _ )

bangpath:  uunet.uu.net!dssmktg!rob| Fax: 714.771.3028  |          \`-'/
     I used to not know, now I know I don't know.                   \_/



Mon, 10 Jun 1996 06:53:03 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Need help with DISPLAY ARRAY problem.

2. Help needed with displaying arrays in 4gl

3. 4gi input array/display array

4. Need help - problem with array storage

5. Newbie needs help with array problem

6. Problem with DISPLAY ARRAY statment

7. Array Display Problems

8. help display dynamic array

9. Design problem - need to extract data from array type structure

10. Arrays in SQL ????? - Need Help

11. Array help Needed

12. Student Needs Serious Help with Array


 
Powered by phpBB® Forum Software