[Last Call] Learn how to a build a cloud-first strategyRegister Now


Translating a C Type to Delphi Type.

Posted on 2004-11-25
Medium Priority
Last Modified: 2010-04-05
I have a trouble to translate this type to Delphi. It seem not to working peoperly.
Anyone please help me.

typedef struct {
  unsigned char type;
  union {
    double Double;
    float Float;
    int Int;
    long Long;
    STRING *Str;
#if VERSION_10X > 45
    COMPLEX Complex;
#ifdef VISSIM_H
    struct sig_vec FAR* v;
    MATRIX *m;
    SCALED_INT scaledInt;
  } u;
  struct node_info* n; /* For Version 3.0 */
Question by:wajatimur
1 Comment

Accepted Solution

vadim_ti earned 375 total points
ID: 12674610
 PSig_Vec = ^TSig_Vec;
  PMatrix = ^TMatrix;
  PNodeInfo = ^TModeInfo;

   tUnion1 = record
      case byte of
         0: (dbl:Double);
         1: (flt: Single);
         2: (int:Word);
         3: (long: Integer);
         4: (str:  PChar);
         5: (cmpl: TComplex);
         6: (v:  PSig_Vec);
         7: (m: PMatrix);
         8: (scaledInt: TScaledInt);

   TSIGNAL = packed record
      tp: Byte;
      u: tUnion1;
     n: TModeInfo;

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question