11.10.2025, 04:06 AM
(This post was last modified: 11.10.2025, 11:17 AM by Dale Yarker.
Edit Reason: paste code deleted some text. On edit it did not place code at cursor. shifted text.
)
Lots of multiplying by 11. try this:
((this text belongs below the code. See Reason for edit.))
You said "... (the routines formatStarRA, formatStarDec and J2000Topo
only account for about 0.3 seconds).
0.3 seconds may become significant with all *11 gone.
If those functions are only called from DoubleStarLoad, then put their code as GOSUBs within DoubleStarLoad.
Posted while I was working: " I reformatted the data to one string per line with a fixed length for each element. Much faster - I suppose 11x faster."
You got rid of the *11 another way.
GOSUB suggestion still stands if they're only called from here.
Cheers,
((this text belongs below the code. See Reason for edit.))
You said "... (the routines formatStarRA, formatStarDec and J2000Topo
only account for about 0.3 seconds).
0.3 seconds may become significant with all *11 gone.
If those functions are only called from DoubleStarLoad, then put their code as GOSUBs within DoubleStarLoad.
Code:
function DoubleStarLoad as long
local t as long
local tempRA, TempDec as double, dummy as string
for t= 0 to 26399 step 11
DoubleStarData(t).CST=read$(t+1)
DoubleStarData(t).ObjName=read$(t+2)
DoubleStarData(t).SAO=read$(t+3)
tempRA=formatStarRA(read$(t+4)
tempDec=formatStarDec(read$(t+5)
J2000Topo(tempRA,tempDec)
DoubleStarData(t).RA=tempRA
DoubleStarData(t).Dec=tempDec
DoubleStarData(t).Magnitude1=read$(t+6)
DoubleStarData(t).Magnitude2=read$(t+7)
DoubleStarData(t).Spectral=read$(t+9)
DoubleStarData(t).Distance=val(read$(t+10)
DoubleStarData(t).Separation=read$(t+11)
next t
'I don't repeat the DATA here.
end function
Posted while I was working: " I reformatted the data to one string per line with a fixed length for each element. Much faster - I suppose 11x faster."
You got rid of the *11 another way.
GOSUB suggestion still stands if they're only called from here.
Cheers,