Hi All Declare Experts,
Background: I am developing a dyLib and DLL to access an external library (not a plugin). Currently I am testing ‘libSwEpLib.dylib’ on the macOS 13.7.4. The code librrary is written in ‘C’. Xojo version 2024 Release 4.2.
Why I think ‘libSwEpLib.dylib’ is working:
Declare Function swe_get_library_path Lib kLibSWE ( path As CString ) As CString
path = swe_get_library_path(path)
This code correctly returns the internal path.
So far, so good. Now comes a much more complex call and the one I am having trouble with.
The ‘C’ API call into the 'swe_rise_trans’ that looks like this:
ext_def (int32) swe_rise_trans(double tjd_ut, int32 ipl, char *starname, int32 epheflag, int32 rsmi, double *geopos, double atpress, double attemp, double *tret, char *serr);
Here is the code I set up for a test with static values:
Var tjd_ut As Double
Var ipl As Int32
Var starname As String
Var epheflag As Int32
Var rsmi As Int32
Var geopos() As Double
Var datm() As Double
Var atpress As Double
Var attemp As Double
Var tset() As Double
Var serr As String
Var return_code As Int32
tjd_ut = 2435430.594444
ipl = 0
starname=""
epheflag = 258
rsmi=1 ' SE_CALC_RISE=1, SE_CALC_SET=2
//
geopos.Add(-75.16666666667)
geopos.Add(39.95)
geopos.Add(0)
//
datm.Add(1013.25) // atmospheric pressure
datm.Add(15) // atmospheric temperature
//
atpress = 0
attemp = 0
serr = ""
return_code = -3
Declare Function swe_rise_trans Lib kLibSWE ( tjd_ut As Double, ipl As Int32, starname As CString, epheflag As Int32, rsmi As Int32, ByRef geopos, datm[0] As Double, datm[1] As Double, ByRef tset, serr As CString ) As Int32
return_code = swe_rise_trans(tjd_ut, ipl, starname, epheflag, rsmi, geopos, datm(0), datm(1), tset, serr)
Return tset(1)
This generates this compile error:
Location:
SwissEphemeris.calc_rise_and_set Declaration
Issue:
Syntax error
Function calc_rise_and_set(tjd_ut As Double, ipl As Int32, starname As String, epheflag As Int32, rsmi As Int32, ByRef geopos, datm[0] As Double, datm[1] As Double, ByRef tset, serr As String) As Double
Can anyone tell me what I have mismapped or I am simply doing wrong?
I was able to fix a decakre error by the following:
But I have tried what I currently understnd but can’t fix the issue.
Any thoughts?
Thanks,
John…