Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: This example illustrates how to use dsdir.obj/.gnt in your COBOL Dialog System application. Buttons defined within the File menu are used to collect and return Resolution: INTRODUCTION ============ This example illustrates how to use dsdir.obj/.gnt in your COBOL Dialog System application. Buttons defined within the File menu are used to collect and return information to the main program. SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- NewSet.cbl Example program using File menu buttons. Open and Save to collect filenames for file processing. OPERATION: ========== When I started Dialog System to create a n
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 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: 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: 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
Problem: This example program demonstrates how to use the Windows SDK functions to read and write to a system .INI file. These functions have been replaced by the Registry functions in 32-bit programs (see COBREG sample) but still exist to maintain compatibility with 16-bit programs. This program will read the WIN.INI file looking for the following entry: [NetExpressApp] NetExpressKey= If it finds the entry it will display the value associated with NetExpressKey. If it does not find the entry it will go ahead and create it and then read it back and display the value associated with NetExpressKey. Resolution: INTRODUCTION ========== This example program demonstrates how to use the Windows SDK functions to read and write to a system .INI file. These functions have been replaced by the Registry functions in 32-bit programs (see COBREG sample) but still exist to main- tain compatibility with 16-bit programs. This program will read the WIN.INI file looking for
Problem: This demo shows how to use the usage of the GetFileAttributes and SetFileAttributes APIs. This sample will set a file as Read-Only. Resolution: INTRODUCTION ========== This demo show how to use the usage of the GetFileAttributes and SetFileAttributes APIs. This sample will set a file as Read-Only. SOURCE FILES: ========== Program Files Description ------------------- ----------------------------------------------------------- fileattribute.cbl OPERATION: ======== Rebuild and animate program. ========================================================== Keywords: demonstration, sample, example, demo, win32 api, attrib.zip demo.ex demo.me demo.ne Attachments: attrib.zip Old KB# 4159
Problem: This shows how to find free disk space on a drive using Windows API calls Resolution: INTRODUCTION ========== Find Free Disk Space on a Drive using Windows API calls SOURCE FILES: ========== Program Files Description ---------------- ----------------------------------------------------------- diskinfo.cbl Main program for sample Copy Files: ---------------- ----------------------------------------------------------- miniwin.cpy winerror.cpy wintypes.cpy OPERATION: ======== Open project and rebuild application ========================================================== Keywords: demonstration, sample, example, demo, win32 api, freediskspace.zip demo.ex demo.ne Attachments: freediskspace.zip Old KB# 4170
Problem: Passing arguments from a URL Resolution: INTRODUCTION ========== The cgiraw demo shows how to read in html form data or url data without having to use external-form data items in the COBOL cgi program. The raw data will be output as html. SOURCE FILES: ========= Program Files Description ------------------- ----------------------------------------------------------- cgiraw.cbl COBOL program that reads form data coming from a web server. Form Files: ------------------- ----------------------------------------------------------- HTMLPage.htm The html page that contains form and url data that can be submitted to the  
Problem: Example of using an Indexed file to track multiple executions of the same program Resolution: INTRODUCTION ========== This project uses an indexed file to track multiple executions of the same program. SOURCE FILES: ========= Program Files Description ------------------- ----------------------------------------------------------- AppNmbrs.APP NetExpress project file Snapa.CBL COBOL source code Snapd.CBL COBOL source code Snapm.CBL COBOL source code Snapq.CBL COBOL source code Copy Files: ------------------- --
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.