devxlogo

Tip Bank

Using Format Function to Right Justify

Question: When using printer.print statements to send output directly to the printer, it used to be possible in QB PDS to use something like “printer.print format(number, “###,###.00”) to get right

Using Variables in SQL

Question: I have connected a form to the DB using an ADODC. I connect fine, I can read the DB if I put a literal in my sql: recordsource =

Manually Positioning Buttons in a Java Applet

You can use Java’s layout managers to maintain the relative position of objects in an applet without manually repositioning them as the applet’s size changes. However, you may occasionally want

Where Should Template Definitions Appear?

Normally, you declare functions and classes in a .h file and place their definition in a separate .cpp file. With templates, this practice isn’t really useful because the compiler must

The First Rule of Code Optimization

I recently received a question from a reader who asked how to sort a large file. My solution was based on the qsort() algorithm, which is the only sorting algorithm

Floating Point Literals

In following expression: if (ticket_price > 7.50) What’s the type of the literal 7.50? One might think that it’s float. However, the actual type is double. To force the compiler