Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: In some versions of COBOL (namely AS/400) calling an array and setting the table index to zero works. However, in Micro Focus COBOL this returns an error ("153 subscript out of range") as the default value is set to one. In order to maintain compatability with other mainframe dialiect it is possible to modify the default setting to zero. Resolution: A program would compile correctly with the default directives: 1 ind-2 usage index. 1 t1 occurs 10 indexed by ind-1. 3 pic xxxx comp-5. set ind-1 to 0 set ind-2 to 0 Old KB# 4269
Problem: This Dialog System example illustrates how to get a button press returned to the COBOL program. Resolution: INTRODUCTION ============ This Dialog System example illustrates how to get a button press returned to the COBOL program. SOURCE FILES: ============= Program Files Description ----------------- ----------------------------------------------------------- NewSet.cbl Modified generated COBOL program that processes buttons in a dialog. Copy Files: ======= Newset.cpb Generated copy book for screenset. OPERATION: ========== To learn how this example was created edit NewSet.gs. You may have to open the file with Dialog System in order to do this. Click Screenset (menu), Data block... (button). Two data items were added. MY-OK-BUTTON&nbs
Problem: The Dialog System "Color Selection" dialog box for setting colors of controls has a very limited selection of colors to choose from. To get a more varied selection of color choices, you can use the Micro Focus GUI Class Library. This means that you will have to add extra Dialog code for each control that you want to color by way of the class library. Resolution: INTRODUCTION ========== The Dialog System "Color Selection" dialog box for setting colors of controls has a very limited selection of colors to choose from. To get a more varied selection of color choices, you will have to make use of the Micro Focus GUI Class Library. This means that you will have to add extra Dialog code for each control that you want to color by way of the class library. To enable use of the class library from within Dialog System, add the following code to the SCREENSET-INITIALIZED event in Screenset...Global Dialog: CLEAR-CALLOUT-PARAMETERS $NUL
Problem: This demo shows how you can create a Windows control panel application using Net Express and Dialog System. Resolution: INTRODUCTION ========== This demo shows how you can create a Windows control panel application using Net Express. SOURCE FILES: ========== Program Files Description -------------------- ----------------------------------------------------------- CPIApplet.cbl controlpanel.cbl Copy Files: -------------------- ----------------------------------------------------------- commdlg.cpy mfres.cpy minwin.cpy winbase.cpy winclass.cpy winerror.cpy wingdi.cpy winnls.cpy wintypes.cpy winuser.cpy controlpanel.cpb mfres.h DS Screenset: -------------------- ----------------------------------------------------------- controlpanel.gs Resource Files: ----
Problem: This is a sample of how to use UPPER CASE FUNCTION two different ways Resolution: INTRODUCTION ========== This HTML form illustrates the use of JavaScript to convert the string in input fields to uppercase. SOURCE FILES: ========= Program Files Description ---------------------- ----------------------------------------------------------- ToUpperCase.APP NetExpress project file Form Files: ---------------------- ----------------------------------------------------------- HTMLPage.htm HTML form with embedded JavaScript OPERATION: ======== This project does not contain a CGI since the process is done by an embedded JavaScript within the HTML form. This sample shows how to convert string to uppercase by us
Problem: This demo shows how to make a Dialog System entry field blink by alternating the background color of the field. Resolution: INTRODUCTION ========== This demo shows how to make a Dialog System entry field blink by alternating the background color of the field. It uses the Dialog System TIMEOUT function to intermittently execute a procedure in the window dialog that alternates the background color (using the SET-COLOR function) of the entry field between yellow and the default color. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- dsblink.app Net Express project dsblink.cbl Main COBOL source code dsblink.cpb Dialog System datablock copyfile dsblink.g
Problem: This demo shows how you can use a HTML Link (A HREF) to call a COBOL CGI passing parameters Resolution: ========================================================== Keywords: demonstration, sample, example, demo, web programming, links.zip demo.ex demo.ne demo.se Attachments: links.zip Old KB# 4205
Problem: You might be using dsrunner with more than one ScreenSet. When you minimize the second one, and try to reactivate it by the dsrunner function "SWCH", the minimized ScreenSet does not get reactivated and remains in the task bar. Resolution: It is possible to get back a minimized window by a USER-EVENT posted from one ScreenSet to the other. Before you can do so, you have to transfer the WINDOW-HANDLE via a DSRUNNER shared memory area. The ScreenSet receiving the USER-EVENT, can do a RESTORE-WINDOW and a SET-FOCUS. The attached sample is a modified version of the DDESAMPL provied with Net Express The followng modifications were made: --------------------------- In every ScreenSet: - Add to the data blocks, immediately after the last DSRUNNER variable "DSRUNNER-PARAM-STRING" HWND-SAMPL  
Problem: This sample show how to trap Function Keys events - F3 & F10 in this sample - before Windows does. This is achieved by sub-classing the object (e.g. entry field) where the F10 or F3 should be intercepted. ***This demo can also be used to trap any keys, not only Function keys. Resolution: INTRODUCTION ========== Pressing the F10 function key activates the menu and F3 function key to exit screen in Windows. This sample show how to trap these events before Windows does. This is achieved by sub-classing the object (e.g. entry field) where the F10 or F3 should be intercepted. ***This demo can also be used to trap any keys, not only Function keys. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- NewSet.cbl Prog
Problem: The default stack allocation for Windows programs is 1MB. How can this be increased? Resolution: If you want to increase that for your executable program (if, say, it has a very large local-storage section) you can set the LINK environment variable before linking and the linker will set the appropriate property: SET LINK="/stack:10000000" If you need to increase stack allocation for a program that's already linked you can use the Windows editbin utility: editbin /STACK:10000000 myprog.exe Old KB# 4253
Problem: In the Net EXpress IDE you may have accidently made the toolbar disappear - how can you make it reappear? Resolution: Select View > Dockable Windows and then check the toolbar option. It will reappear as 'floating' - but then you can dock it if required. Old KB# 4211
Problem: Error codes delivered by CBL_ routines: Byte-stream File Routines: CBL_CLOSE_FILE, CBL_CREATE_FILE, CBL_FLUSH_FILE, CBL_FREE_RECORD_LOCK, CBL_GET_RECORD_LOCK, CBL_OPEN_FILE, CBL_READ_FILE, CBL_TEST_RECORD_LOCK, CBL_WRITE_FILE File and Filename Routines: CBL_CHANGE_DIR, CBL_CHECK_FILE_EXIST, CBL_COPY_FILE, CBL_CREATE_DIR, CBL_DELETE_DIR, CBL_DELETE_FILE, CBL_DIR_SCAN_BEGIN, CBL_DIR_SCAN_END, CBL_DIR_SCAN_READ, CBL_GET_CURRENT_DIR, CBL_JOIN_FILENAME, CBL_RENAME_FILE, CBL_SPLIT_FILENAME, PC_FIND_DRIVES, PC_READ_DRIVE, PC_SET_DRIVE ... Resolution: Customers sometime ask SupportLine, what does this "14-thousand-somewhat"-RETURN-CODE or status mean, which is delivered by a CBL_Routine. This knowledge base article should be found by the Google search when a status like "14657" is entered. ----------------------------------------------------------------------------- For all these routines, if the routine is successful
Problem: This example demonstrates the use of the Win32 SDK ODBC functions to get information about installed ODBC drivers. Resolution: INTRODUCTION ========== This example demonstrates the use of the Win32 SDK ODBC functions to get information about installed ODBC drivers. This example uses the direct ODBC function calls instead of using the Net Express OpenESQL preprocessor. This program will display a list of all ODBC drivers installed on your system and will then open a connection to the Net Express Sample1 DSN and display information about it. This sample DSN is installed along with the Net Express demo programs. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- ODBCINFO.CBL Program that calls the ODBC functions. SQLFUNC.CPY &
Problem: Every time a COM registered component was created there was a slight delay. This leads to a performance issue when componants are consistantly being created. Resolution: This was due to a "wins" server being specified in TCPIP setting. The wins setting should not have been specifed as the site was using a dns server. Old KB# 4193
Problem: Using Win 32 API to create a new process in COBOL Resolution: INTRODUCTION ========== This example demonstrates the use of the Win32 API function call CreateProcess in order to execute a non-COBOL program from within a COBOL program. In this example, the Windows Text Editor NOTEPAD.EXE will be executed. The program will then wait until NOTEPAD has been exited at which point it will also exit. CreateProcess allows you to control how a program is started along with the parameters the environment and the working directory that the new program should use. SOURCE FILES: ========== Program Files Description -------------------- ----------------------------------------------------------- CREATEP.CBL Program that calls the CreateProcess function. WINTYPES.CPY Copy file
Problem: Would like to know how to do old DOS Landscape Print reports in Net Express ? When converting a system that prints 132 character width and 66 lines to a page how can you get this working using Windows. Resolution: You can use the printer redirection runtime tunable to redirect print to the Windows Print spooler. You can also then use the PC_PRINTER routines to switch into Landscape mode and use a suitable monospaced font. An example of this approach is attached. Attachments: redir.zip Old KB# 4202
Problem: This shows how to disable an html text input field programmatically through the CGI program and JavaScript code Resolution: INTRODUCTION ========== This demo shows how to disable an html text input field programatically through the CGI program and Javascript code. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- disablefield.app project file mycgi.cbl Internet App Wizard generated cgi program Copy Files: ------------------- ----------------------------------------------------------- mycgi.cpf Form fields copyfile mycgi.cpy &nb
Problem: This program demonstrates the use of Win32 API calls SHBrowseForFolder and SHGetPathFromIDList to display a dialog box that will allow the user to select a directory. Resolution: INTRODUCTION ========== This program demonstrates the use of Win32 API calls SHBrowseForFolder and SHGetPathFromIDList to display a dialog box that will allow the user to select a directory. SOURCE FILES: ========= Program Files Description -------------------- ----------------------------------------------------------- getDirectory.cbl COBOL program with logic to show a folder browser dialog. getDirectory.gs Dialog System screenset. Copy Files: --------------------  
Problem: This is a Web demo which demonstrates the use of COBOL to validate FORM input fields and uses JavaScript to display an error message place focus on the filed in error. Resolution: INTRODUCTION ============ This Web program demonstrates the use of a COBOL CGI program to do validation of the form input fields. If an error is encountered, a message box (alert) is displayed thru the web page and focus is placed on the input field in error. To do this, three hidden input fields are used on the web page: one (errors) that will be toggled between "y" or "n" to denote if an error exists, one (msg) that contains the error message to be displayed, and one (focusfld) to contain the name of the input field to place the focus on. The COBOL program populates the three hidden fields. Javascipt is used to check if the errors field is "y" and displays an alert message if true. Notice the onload parameter of the BODY tag in the html. I
Problem: This shows how to show the Win32 Platform, Version number, Build number using WIN 32 APIs Resolution: INTRODUCTION ========== Demonstrate how to use the GetVersion API. This version will work on all current version of Windows OS SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- showos.cbl OPERATION: ======== Rebuild project and run or animate. ========================================================== Keywords: demonstration, sample, example, demo, win32 api, showos.zip demo.ex demo.ne Attachments: showos.zip Old KB# 4190
Problem: This example demonstrates the use of the Win32 SDK function FormatMessage to receive an error message text associated with a specified error number. Normally this would be used in conjunction with the GetLastError function in order to receive the error message text associated with an error returned by the last Win32 SDK function call. This example will simply display the error message text for the first 20 system errors numbered 0 through 19. This example also demonstrates the use of COBOL typedefs. Resolution: INTRODUCTION ========== This example demonstrates the use of the Win32 SDK function FormatMessage to receive an error message text associated with a specified error number. Normally this would be used in conjunction with the GetLastError function in order to receive the error message text associated with an error returned by the last Win32 SDK function call. This example will simply display the error message text for the first 20 system errors numbered 0 through
Problem: Returning a short filename from a long file name under COBOL using the Win32 APIs Resolution: SOURCE FILES: ========= Program Files Description ----------------- ----------------------------------------------------------- Longname.cbl The program makes a winapi call to create a short filename Resource files: ---------------- ---------------------------------------------------------- Makes a call cob32api before winapi calls. REQUIREMENTS: ========== OPERATION: ======== Before using the demo... Create a "Long filename" on disk called "My filename" - use: echo "Hello" >"My filename" The program makes a winapi call to get a short pathname Program then checks status code for success or error. NOTE: ==== Set
Problem: This demo shows how to prevent user from submitting the form more than once using JavaScript. Resolution: INTRODUCTION ========== This demo shows how to prevent user from submitting the form more than once using JavaScript. SOURCE FILES: ========== Program Files Description ----------------------- ----------------------------------------------------------- mycgi.cbl CGI program Copy Files: ----------------------- ----------------------------------------------------------- mycgi.cpf Generated by Form Designer mycgi.cpv
Problem: This example program demonstrates how to find the executable program name which is associated with a particular file extension and then use it to open the specified file. It uses the two Win32 API functions FindExecutable and CreateProcess. Resolution: INTRODUCTION ========== This example program demonstrates how to find the executable program name which is associated with a particular file extension and then use it to open the specified file. It uses the two Win32 API functions FindExecutable and CreateProcess. File associations are made in Windows Explorer under the File Types option. This example uses the filename DUMMY.CBL which is associated with Net Express when it is installed. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- FINDEXE.CBL &nb
Problem: This is a sample page whichs shows how to: add items to the ActiveX list box, add items to the ActiveX selection box, add tabs to the ActiveX tab strip control, and show/hide controls when a tab change is made on the tab strip control Resolution: INTRODUCTION ========== This HTML form illustrates the use of JavaScript on some ActiveX controls. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- JSandActX.APP NetExpress project file Form Files: ------------------- ----------------------------------------------------------- HTMLPage.htm HTML form with embedded JavaScript and ActiveX controls OPERATION: ======== This project does not contain a CGI since the process is done
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.