PENULTIMATE "display array" substitute!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Posted in 1994
Topics: Installation, Setup & Upgrades, Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
__ I have found what I was looking for {:^(__) I have discovered that there is a tremendous archive of INFORMIX info & sources at "mathcs.emory.edu". I searched the cumulative index (750+ K!), and found dozens of references to DISPLAY ARRAY. I xferred them all 'home', and started to weed... when what should appear to my aching eyes, but the included shell archive, called, inoccuously enough, "arrdemo". Ladies and gentlemen, the author, Bob Kane, *must* be applauded for this effort. I, and many of you, may have hacked nifty some code in 4GL... but this is exquisite! Everything I've seen complained about in DISPLAY ARRAY, in all the old news archives I perused, is here: - highlighting current item - scroll wrap from last to first on 'next page' - hit first key to get to item that starts with that key ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (this is what I consider to be 'the ideal'!) - others? (I can't wait to find out) I'm so 'appee! I haven't had much chance to work with it yet, but it's very very very promising. And, it's 4GL. Note that the included C source simply provides fgl_keyval() and fgl_getkey()...which INFORMIX then included in 4.1 (?) of their 4GL --- this means you may not need them (I thought I'd send the thing along intact, to be sure). Christmas in September! "YESSSSSSSSS"!!!!!!!! Enjoy, all, and pass it on! William G. Hudacek Internet: whudace@dad.bgsu.edu 372-2911 (department) University Computer Services (Hayes Hall, Rm 332) Bowling Green State University Bowling Green, OH 43403 x---x Cut Here x---x Cut Here x---x Cut Here x---x Cut Here x---x Cut Here x--x #!/bin/sh # # This is a shell archive. To extract its contents, # execute this file with /bin/sh to create the file(s): # # README.1ST d4_cust.4gl disparr.4gl usr_funcs.c # README.2ND d4_globals.4gl # # This shell archive created: Mon Dec 28 13:33:53 EST 1992 # echo "Extracting file README.1ST" sed -e 's/^X//' <<\\SHAR_EOF > README.1ST XThese files comprise a demonstration of a method for handling the display of Xarrays in Informix-4GL created by Bob Kane <bob@worms-emh2.army.mil>. Bob's Xcomments in README.2ND refer to his original distribution method of using a Xtar file. You may need to modify his installation instructions somewhat since Xthese files come to you in a shell archive. X XWalt Hultgren Xwalt@rmy.emory.edu SHAR_EOF if [ `wc -c < README.1ST` -ne 387 ] then echo "Lengths do not match -- Bad Copy of README.1ST" fi echo "Extracting file README.2ND" sed -e 's/^X//' <<\\SHAR_EOF > README.2ND XThis tar file includes 3 4GL modules and a module written in 'c'. In order Xto run the sample code for the screen array function, you must first install Xthe 4GL demo code that comes with most version of Informix 4GL. I designed Xthis sample code to replace some of the demo code, so I would not have to Xinclude an entire application with modules, forms, a database, and data files. X XAfter installing the 4GL demo code, usually by typing 'i4gldemo', you will Xneed to untar the replacement modules from the arrdemo.tar file. These Xare 'd4_globals.4gl', 'd4_cust.4gl', 'disparr.4gl' and 'usr_funcs.c'. Note: Xthe 'usr_funcs.c' was written by Dave Snyder and included with his excellent Xpublic domain 4GL programs and functions. If you are using release 4.1 of X4GL, you will not need the functions in 'usr_funcs.c' since their equivalent Xis included in this release. X XAfter you have untared the replacement code, you will need to recompile the X'demo4.4ge' program. You need to included the following modules: X X *d4_globals.4gl X d4_main.4gl X *d4_cust.4gl X d4_orders.4gl X d4_stock.4gl X d4_report.4gl X d4_demo.4gl X *disparr.4gl X X *usr_funcs.c X X* New or replacement modules. X XOnce you have recompiled, give a try adding a new customer. As soon as you get Xinto the state field, type in an invalid 2 digit state code and the new display Xarray function will pop-up. You can also leave the field blank. One you get Xthe array up, press any letter, and the array will magically move to that Xposition. The standard keys like, 'Page Up', 'Page Down', and 'UP' or 'DOWN' Xarrow are also implimented. You will also note that the highlight bar moves Xalong with your cursor movement. Enjoy! Please send any bugs or enahance- Xments to bob@worms-emh2.army.mil. My thanks to Dave Snyder and his fgl_getkey Xand fgl_keyval functions that allow this whole thing to work. SHAR_EOF if [ `wc -c < README.2ND` -ne 2041 ] then echo "Lengths do not match -- Bad Copy of README.2ND" fi echo "Extracting file d4_cust.4gl" sed -e 's/^X//' <<\\SHAR_EOF > d4_cust.4gl XGLOBALS X "d4_globals.4gl" X X XFUNCTION customer() X X OPTIONS X FORM LINE 7 X OPEN FORM customer FROM "custform" X DISPLAY FORM customer X ATTRIBUTE(MAGENTA) X CALL ring_menu() X CALL fgl_drawbox(3,32,3,42) X CALL fgl_drawbox(3,61,8,7) X CALL fgl_drawbox(11,61,8,7) X LET p_customer.customer_num = NULL X MENU "CUSTOMER" X COMMAND "One-add" "Add a new customer to the database" HELP 201 X CALL add_customer(FALSE) X COMMAND "Many-add" "Add several new customer to database" HELP 202 X CALL add_customer(TRUE) X COMMAND "Find-cust" "Look up specific customer" HELP 203 X IF query_customer(23) THEN X NEXT OPTION "Update-cust" X END IF X COMMAND "Update-cust" "Modify current customer information" HELP 204 X CALL update_customer() X NEXT OPTION "Find-cust" X COMMAND "Delete-cust" "Remove a customer from database" HELP 205 X CALL delete_customer() X NEXT OPTION "Find-cust" X COMMAND "Exit" "Return to MAIN Menu" HELP 206 X CLEAR SCREEN X EXIT MENU X END MENU X OPTIONS X FORM LINE 3 XEND FUNCTION X X XFUNCTION add_customer(repeat) X DEFINE repeat INTEGER X X CALL clear_menu() X MESSAGE "Press F1 or CTRL-F for field help; ", X "F2 or CTRL-Z to return to menu" X IF repeat THEN X WHILE input_cust() X ERROR "Customer data entered" ATTRIBUTE (GREEN) X END WHILE X CALL mess("Multiple insert completed - current screen values ignored", 23) X ELSE X IF input_cust() THEN X ERROR "Customer data entered" ATTRIBUTE (GREEN) X ELSE X CLEAR FORM X LET p_customer.customer_num = NULL X ERROR "Customer addition aborted" ATTRIBUTE (RED, REVERSE) X END IF X EN