May 6, 1997

Creating paradox-type tables at runtime

Question: I want to create paradox-type tables at runtime, which I am generally doing in this way:Table1.FieldDefs.Add(‘IDnum’, ftInteger, 0, False)….Table1.CreateTableHowever, there seems to be no FieldType for an auto-increment number like you can choose in Paradox database desktop. I was hoping for something like ftAutoInc, but in Delphi 1 it

How to access your comport

Question: How can I access my comport? How can I send bytes to the datatransfer pin? I’m using Delphi 1.0I’ve tried writecomm and transmitcommchar (and I’ve opened the port with opencomm) but I don’t think it sends anything. Is there an easier way? I saw something about writefile/ex but couldn’tfind

‘Structs and classes

Question: Please examine my code and tell me what I am doing wrong!This is the first part of my program:#include #include class LinkedLst{ public: LinkedLst(); //Constructor void AddToFront(int Value); //Add Value to the front of the list void Print(); //Print the list elements void Average(); //Calculate and print the average

Overloading the assignment operator “=”

Question: I am puzzled at the way in which the assignment operator is overloaded in C++. Would you please show an example as to what efficient code for overloading this operator would look like. Specifically, my confusion is about how this function would copy old resources into new resources before

ActiveX and Delphi

Question: Does Delphi support ActiveX? If so, do I need something extra to run ActiveX controls in Delphi? Answer: As long as the OCX is registered (which you can do in the Component|Install menuchoice), you can use it in Delphi. Just drop it in. Delphi 2.0 has apalette of sample

Type conversion

Question: How does one convert a double to an int? Is there a function like floor that actually returns an int? Answer: There are many things you can do to convert a float to an int depending upon what results you expect. If you want to use the built-in languageconversions,

The time.h Header File

Question: I am trying to write a program that provides a constructor that’s capable of using the current time from the time() function declared in the C standard library header to initialize an object of the time class and provide an output of the format H:MM:SS. Answer: It’s very simple,

Program fails because do … while loop needs braces

Question: I’m a beginner in C programming. I have Microsoft Visual C++ 4.0.I’ve read the book Programming with C by Byron Gottfried.Unfortunately, no matter which simple program I try to write, I always run into a mistake. The error I make doesn’t seem wrong, so I don’t know what to

Processor fault

Question: Why do I get with the following program, this error: general protection exeption, 0x215f:0x1ef3timer(1) 0x215f:0x1ef3 Processor fault.Program (very small):#include #include int get_value (int _value);void main (void){ int _time=0; int _timemod=1; clrscr(); while (_time < 1000) { _time++; if (_time == 100) { get_value(_timemod); gotoxy (30,6); printf ("%d", _timemod); _time

No more posts to show