Page 1 of 1

Errors in DCAL functions

PostPosted: Mon Nov 27, 2006 10:12 am
by devinder
Declaration for menuMove is case sensitive. It should have been menumove (all lower case). In UInterfaces.pas the DCAL function should read as
Code: Select allProcedure menumove(Var iwant: wantType); stdcall; external AppName;

Errors in DCAL functions

PostPosted: Mon Dec 11, 2006 9:39 am
by devinder
Declaration for callDgetstr132 is case sensitive. The correct declaration for UInterfaces.pas is as follow:

Code: Select allPROCEDURE callDgetstr132(VAR str: str132; len: aSInt;
   VAR arg: DgetstrArg; VAR iwant: wantType); stdcall; external AppName;

PostPosted: Tue Dec 12, 2006 8:52 am
by devinder
Another declaration error (case sensitive) in uinterfaces.pas. Please correct your uinterfaces.pas.

Code: Select allPROCEDURE callgetflname1_255(VAR str, pth , suffix : str255; prompt : integer;
             VAR entire_name : str255; addext : boolean;
             names : boolean; chkit : boolean;
             VAR arg : getflname1Arg; VAR iwant : wantType);stdcall; external AppName;

PostPosted: Fri Jan 05, 2007 10:06 am
by devinder
callMoveDrag function is not a valid DCAL function and should renamed to menuMovedrag
Code: Select allPROCEDURE menuMovedrag (ForceAndCopy : boolean; msg1, msg2 : aSInt; VAR arg : MoveDragArg; VAR iwant : wantType);stdcall;external AppName;

PostPosted: Thu Jan 11, 2007 11:47 am
by devinder
If you are using 11.08, you will need to update view_type record in URecords.pas. A new clipz boolean field was added. Without this flag, crashes may occur.

Code: Select all   view_type = packed record
      addr: lgl_addr;    { Address of stored view }
      addrspc: adsmem;      { Current drawing file }
      Next: lgl_addr;    { Next view in list if any }
      prev: lgl_addr;    { Previous view in list if any }
      viewmode: aSInt;     { Type of projection }
      vmat: modmat;      { Viewing xform matrix }
      cmat: modmat;      { Post-clipping xform matrix }
      emat: modmat;      { Editing matrix }
      imat: modmat;      { Inverse of editing matrix }
      prspct: boolean;     { True if perspective mode }
      clipon: boolean;     { True if clipping cubes on }
      Name: string[9];   { Name of view if any }
      clpmin: point;       { Clipping cube minimum }
      clpmax: point;       { Clipping cube maximum }
      xr: aFloat;       { Window/viewport x position }
      yr: aFloat;       { Window/viewport y position }
      scale: aFloat;       { Window/viewport scale }
      scalei: aSInt;     { View drawing scale }
      perscent: point;       { Perspective center of view }
      perseye: point;       { Perspective eyepoint }
      persdis: aFloat;       { Perspective distance }
      togglelyr: boolean;     { True of toggling of layers on }
      frstlyr: lgl_addr;    { Address of first entry in layer list }
      lastlyr: lgl_addr;    { Address of last entry in layer list }
      currlyr: lgl_addr;    { Address of current layer for this view }
      flag1: byte;        { General purpose flag }
      { Changed in version 7.5 }
      flag2: byte;        { General purpose flag }
      coneang: aFloat;
      frstatr,
      lastatr: lgl_addr;       
      clipNoZ     : boolean;
   END;

PostPosted: Mon Jan 15, 2007 10:01 am
by devinder
Another declaration error (case sensitive) in uinterfaces.pas. Please correct your uinterfaces.pas.

Code: Select allProcedure currwndw(Var lowleft, upright: point); stdcall; external AppName;

PostPosted: Mon Jan 22, 2007 9:25 am
by devinder
betwang function is not a valid DCAL function and should renamed to betweenang in UInterfaces.pas
Code: Select allFUNCTION betweenang (tstang, ang1, ang2 : aFloat) : boolean;stdcall;external AppName;

PostPosted: Tue Jan 23, 2007 9:26 am
by devinder
Following function calls do not work in DCAL, and will require a new DataCAD executable.
Code: Select allatan2
cart_cylind


If you need to utilize these functions, you can use the following code:

Code: Select allFUNCTION atan2(Y, X: aFloat): aFloat;
asm
   FLD     Y
   FLD     X
   FPATAN
   FWAIT
End;

PROCEDURE cart_cylind(x, y, z: aFloat; VAR rad, planang, zdis: aFloat);
BEGIN
   rad := sqrt(sqr(x) + sqr(y));
   planang := atan2(y, x);
   zdis := z;
END;

PostPosted: Tue Feb 27, 2007 9:27 am
by devinder
lyr_clear call has missing "var" keyword. The correct declaration is:
Code: Select allPROCEDURE lyr_clear(var addr: lyraddr); stdcall; external AppName;

PostPosted: Fri Mar 23, 2007 7:53 am
by devinder
Correct Declaration for dis_from_arc is as follows.
Code: Select allFUNCTION dis_from_arc(const center: point; radius, begang, endang: aFloat;
   const tstpnt: point): aFloat; stdcall; external AppName;

PostPosted: Mon Mar 26, 2007 7:52 am
by devinder
Both disfromlin and disfromseg are NOT valid DCAL functions, but dis_from_line and dis_from_seg are the correct functions. You can safely delete the declaration of disfromlin and disfromseg from Uinterfaces.pas