May 31, 2000

Calculating the Absolute Value of a Number

The standard functions abs() and labs() (declared in ) return the absolute value of int and long, respectively. You can use these functions in computations that need absolute values. For example: int begin = 0, end = 100;int offset = abs(begin

Differences Between C and C++ in the Prototypes of Standard Functions

A small number of functions from the Standard Library have different signatures on C and C++. These functions are: strchr(), strpbrk(), strrchr(), strstr(), and memchr() as well as their wide-character counterparts: wcschr(), wcspbrk(), wcsrchr(), wcsstr(), wmemchr(). They are declared in the standard header Let’s look at strstr() for example. While

How to Reduce Compilation Time

Most compilers nowadays have several options that reduce compilation time considerably. These options include incremental build, precompiled header files, and cached header files. By default, these options are turned off. If you find that compiling your applications takes a long time (which is likely if you’re using STL, for example),

Exe Pops Up and Closes Immediately

Question: I have written a simple application with one form. I compiled the project as an .exe. My exe works fine if I am inside VFP, but when I make a shortcut to this exe on my desktop and try to run it, the form flashes by quickly and closes.

VFP Form Management

Question: How do I call a form from another form using a command button? Answer: You can put code into the Click event of the command button that executes a DO FORM command that will bring up the form you want. For example: Create a form called ParentForm by executing

Report in a Separate Window

Question: In a FoxPro 6.0 application, I want to be able to push a button anddisplay a report on the screen. This report should be displayed in a new window, separate from the one containing the button. Answer: The REPORT command has a WINDOW clause that will do what you

Calculating the Maximum of Three Values

The max() macro or template takes two values and returns the highest. What if you need to calculate the maximum of three values? You don’t need to write a special function template for this purpose. Instead, apply max() to two arbitrary values of the three, and then apply max() once