Page 1 of 1

rubln in DCAL for Delphi

PostPosted: Wed Mar 29, 2006 7:36 am
by rod_walker
Hi,
the statement
Code: Select all rubln:=true;

results in 'left side cannot be assigned to.'
I had a quick look through the AEC_MODL samples which uses
rubln^:=true a pointer; but I am too lazy to wade through the logic.
UInterfaces.pas lists rubln as Function rubln:boolean; stdcall; external AppName 'GetSetRubln';
Any advice.
Thanks
Rod Walker

PostPosted: Wed Mar 29, 2006 9:12 am
by devinder
Rubln and Rubbx are functions which returns pointer to a boolean. To access the value, you must use dereference this pointer for boolean type and thus you have to use ^ notation. Your Uinterfaces.pas seems to be wrong, the correct declaration should be as follow:

Code: Select allFunction rubln: Pboolean; stdcall; external AppName Name 'GetSetRubln';


Yours define as a boolean whereas it should be PBoolean. If this is the case I would suggest you to get the header files again from http://www.datacad.com/ddn/downloads/DCAL%20for%20Delphi.zip

Using pointers this variable directly interfaces with the variable that is internally used in DataCAD.


Hope this helps.

PostPosted: Wed Mar 29, 2006 5:28 pm
by rod_walker
Hi,
I am using Delphi 4. When I initially installed Dcal for Delphi I had error messages about pboolean being undefined (or something like that), so I changed pboolean to boolean.
I will download latest version and try again
Thanks
Rod Walker

PostPosted: Wed Mar 29, 2006 5:50 pm
by devinder
if pboolean is undefined in your Delphi 4, you can add the following to URecords.pas

Code: Select allpboolean = ^boolean;


immediately after the declaration "type".

PostPosted: Thu Mar 30, 2006 6:13 pm
by rod_walker
Thanks Devinder,
added pointer as you advised. System working.

Rod Waker