May 28, 1997

Form width and length

Question: My program has two MDI forms. I have an option that allows the user to tile them horizontally or vertically. How can I tell at runtime what the max form width and height are without setting the window’s state to wsMaximized? I tried the screen.width and screen.height, but they

Algorithm to determine if string given by user is palindromic

Question: Develop an algorithm using English pseudo code Java to determine if a string of characters given by the user is palindromic.Algorithm outputs suitable message.Blank characters and punctuation should be ignored when processing the string. Answer: This looks suspiciously like a homework assignment, but I’ll give it ashot anyway.You’ll have

“Cannot Open Component Library” — What to do

Question: I’ve been getting the following errors when I try to launch Delphi:“This program has performed an illegal operation and will be shut down.If the problem persists, contact the program vendor.” Then the followingappears: “Delphi32 caused an invalid page fault in module KERNEL32.DLL at0137:bff9a07c”. “Cannot open component library ProgramsFilesBorlandDelphi2.0BinCMPLIB32.DCL (error

Hiding application

Question: I have a third-party component I am using to make an icon for my app in the Windows 95 system tray. This works great, except that I need to be able to hide the application from the taskbar. How can I do this? Answer: The simplest way to keep

Binding a form to multiple data sources

Question: I am trying to bind a form to multiple tables in a session. If I drag and drop an attribute from a single table into my form, all is well. If I drag and drop an attribute from a second table, my form will ask me if I wish

TQuery command to use to execute a SQL statement

Question: I’m trying to delete multiple records using Tquerysuch as delete from products p where p.shopno in (select shopno from shops)When I run the program, it executes the statements and deletes matching records but gives me an error message such as ‘error creating cursor handle’.What is the reason and what

Paradox: secondary indexes problem

Question: I have just discovered a problem with secondary indexes in Paradox that I desperately need to have solved by yesterday!I have a number of database tables with a primary index : ID (integer), Name (Alpha), and ID2 (integer).I added a secondary index: “Name (Alpha)”.The name, however, is not unique;

Variant Records: The equivalent to the C-union structure

Question: Is there a way to create a C ‘union’-like structure in Delphi? That is, a structure that uses the same memory area? Answer: The Delphi (Pascal/ObjectPascal) equivalent to a C-union structure iscalled a Variant Record (not to be confused with the Variant “type”available in Delphi 2.0+). As with a

Delphi 2.0 cursor handling

Question: How can I get the cursor to advance to the next form field after a field has been filled with the maximum number of characters? I am using Delphi 2.0. Answer: Hmm… sounds like a serial number entry thing to me. Whatever the case,the best way I’ve found to