AlbertAguirre
Programmer
Hello
I havnt written INFORMIX 4GL code in quite sometime but its all coming back to me...
I wrote a CONSTRUCT statement and when i fetch the next row in the scroll cursor I do a display by name.
Problem is that some strange characters appear on the screen. I have no idea how this is happening.
Suggestions? Ideas?
-Albert
SCREEN:
DATABASE carma
SCREEN
{
Record ID: [f1 ]
Created on: [f2 ] Last login: [f3 ]
Username: [f4 ]
First name:[f5 ]
Last name:[f6 ]
Text printer: [f7 ]
Grahics printer: [f8 ]
}
END
TABLES
sec_user
ATTRIBUTES
f1 = sec_user.userid, COMMENTS="User ID";
f2 = sec_user.adddate, COMMENTS="Dater added (mm-dd-yy)";
f3 = sec_user.logdate, COMMENTS="Last date logged on (mm-dd-yy)";
f4 = sec_user.username, COMMENTS="UNIX username";
f5 = sec_user.fname, COMMENTS="First name";
f6 = sec_user.lname, COMMENTS="Last name";
f7 = sec_user.dtext, COMMENTS="Default text printer";
f8 = sec_user.dgraf, COMMENTS="Default graphics printer";
INSTRUCTIONS
DELIMITERS " ";
END
4GL CODE:
FUNCTION run_query(where_clause)
DEFINE where_clause CHAR(1000),
sql_stmt CHAR(2000),
r_sec_user RECORD LIKE sec_user.*
INITIALIZE r_sec_user TO NULL
LET sql_stmt = "SELECT * FROM sec_user WHERE ", where_clause CLIPPED
PREPARE p_sec_user FROM sql_stmt
DECLARE c_sec_user SCROLL CURSOR FOR p_sec_user
OPEN c_sec_user
FETCH FIRST c_sec_user INTO r_sec_user.*
DISPLAY BY NAME r_sec_user.*
MENU "USER QUERY"
COMMAND "Next" "View next record"
FETCH NEXT c_sec_user INTO r_sec_user.*
DISPLAY BY NAME r_sec_user.* ATTRIBUTE(REVERSE)
COMMAND "Previous" "View previous record"
FETCH PREVIOUS c_sec_user INTO r_sec_user.*
DISPLAY BY NAME r_sec_user.* ATTRIBUTE(REVERSE)
COMMAND "Exit" "Exit to the main menu"
CLOSE c_sec_user
RETURN
END MENU
END FUNCTION
NOTE:
I will put next rec and prev rec error checking in later
I havnt written INFORMIX 4GL code in quite sometime but its all coming back to me...
I wrote a CONSTRUCT statement and when i fetch the next row in the scroll cursor I do a display by name.
Problem is that some strange characters appear on the screen. I have no idea how this is happening.
Suggestions? Ideas?
-Albert
SCREEN:
DATABASE carma
SCREEN
{
Record ID: [f1 ]
Created on: [f2 ] Last login: [f3 ]
Username: [f4 ]
First name:[f5 ]
Last name:[f6 ]
Text printer: [f7 ]
Grahics printer: [f8 ]
}
END
TABLES
sec_user
ATTRIBUTES
f1 = sec_user.userid, COMMENTS="User ID";
f2 = sec_user.adddate, COMMENTS="Dater added (mm-dd-yy)";
f3 = sec_user.logdate, COMMENTS="Last date logged on (mm-dd-yy)";
f4 = sec_user.username, COMMENTS="UNIX username";
f5 = sec_user.fname, COMMENTS="First name";
f6 = sec_user.lname, COMMENTS="Last name";
f7 = sec_user.dtext, COMMENTS="Default text printer";
f8 = sec_user.dgraf, COMMENTS="Default graphics printer";
INSTRUCTIONS
DELIMITERS " ";
END
4GL CODE:
FUNCTION run_query(where_clause)
DEFINE where_clause CHAR(1000),
sql_stmt CHAR(2000),
r_sec_user RECORD LIKE sec_user.*
INITIALIZE r_sec_user TO NULL
LET sql_stmt = "SELECT * FROM sec_user WHERE ", where_clause CLIPPED
PREPARE p_sec_user FROM sql_stmt
DECLARE c_sec_user SCROLL CURSOR FOR p_sec_user
OPEN c_sec_user
FETCH FIRST c_sec_user INTO r_sec_user.*
DISPLAY BY NAME r_sec_user.*
MENU "USER QUERY"
COMMAND "Next" "View next record"
FETCH NEXT c_sec_user INTO r_sec_user.*
DISPLAY BY NAME r_sec_user.* ATTRIBUTE(REVERSE)
COMMAND "Previous" "View previous record"
FETCH PREVIOUS c_sec_user INTO r_sec_user.*
DISPLAY BY NAME r_sec_user.* ATTRIBUTE(REVERSE)
COMMAND "Exit" "Exit to the main menu"
CLOSE c_sec_user
RETURN
END MENU
END FUNCTION
NOTE:
I will put next rec and prev rec error checking in later