I have a lot of code which I am wanting to port from Sun's Sparcworks. The main algorithms are in Pascal, but the user interface was written in XView which was linked in via C.
In Sparcworks, linking from Pascal to C involves statements of the following form:
PROCEDURE X_SelAlgorithmn(VAR select_no : integer; VAR smess: string); external c;
This is calling a C function which is returning values for select_no and smess.
Some of my calls included a lot of variables which were set by a complicated form e.g. procedure x_rscinput_form(mc_code: string; var mc_name: string; var efficiency, d_rule_a, avail_ops, shifts, children, dist_rule_b: integer; var x_pos, y_pos, x_size, y_size: real; var tr_dev, audit_p, update_p: integer; var opt_mc_code: string; var hour_rate, ohead_rate: real; var minsu, minmc, mintr, batchsize, transfer, optmcrule: integer; var dist: boolean; var co_name: string); external c;
Thus returning lots of variables with different types from C to Pascal.
With GNU Pascal (thanks to the African Cheif and Kevan) I can pass variables from Pascal to C and I can get single variables back again. Is there a way that I can pass multiple variables into C and back into Pascal without resorting to global variable or using files?
Any help would be very gratefully received.
Many thanks, Chris
Dr Christian Hicks Senior Lecturer, School of Mechanical & Systems Engineering, Stephenson Building, University of Newcastle upon Tyne, NE1 7RU. Phone: +44 191 222 6238 Mobile 0795 8317804 Fax: + 44 191 222 8600 Homepage: http://www.staff.ncl.ac.uk/chris.hicks