Publié : sam. 18/févr./2006 12:09
Merci pour ta réponse gnozal
Historique a écrit :UPDATE TO PB 4.0x
- added new keywords and indentation and/or folding if applicable
- changed /NT4 compiler switch to /SUBSYSTEM NT4
- changed DefType to Define
- added /THREAD compiler switch [language file entry 467]
- added /UNICODE compiler switch [language file entry 468]
- added /SUBSYSTEM OPENGL compiler switch [language file entry 478]
- added compiler restarting if NT4 and/or UNICODE flag has changed [info message : language file entry 469]
- updated syntax coloring for exponential numbers like 123.5e-20
- added brace match check for {} (new fixed length strings)
- added custom subsystem in Project/Options [language file entry 490]
- updated help system
- updated Ref-Purebasic.txt
- adapted Visual Designer plugin
MISC
- the null byte to separate source code and jaPBe options in the saved file is now optional [language file entry 492]
- added context constant autocompletion : only the pertinent constants are shown (only for PB functions) [language file entry 491]
- added a 'Find variable' feature : F1 with cursor on variable (dialog : double-click = goto line) [language file entries 487 - 489]
- added red error marker '>>>' for marking the last compiler error line (reset before compile)
- added menu item 'Goto last error line' [language file entry 485]
- fixed OffsetOf() syntax coloring bug
- added a checkbox in 'Find / Replace' dialog to avoid replacing items by mistake
- added 'TailBite' menu item (to create a user library)
- added option for Tailbite : cut library file name (MyLIB_V5.pb -> MyLIB) [language file entry 486]
- integrated Constant Explorer plugin to jaPBe [F11, or F1 with cursor on constant]
- added option 'Start Constant Explorer after compile error 'Constant not found'' [language file entry 484]
- added 'compile manually to resident' menu item [language file entries 482 - 483]
- added new explorer panel to browse *.pb/*.pbi files (double-click to load the file) [language file entry 479]
- fixed 'automatic add end tags for If/Select/For...'
- fixed #gadget_Pref_ToolbarSkin combobox height
- fixed 'paste from info panel' bug
- added two new options for info panel : 'Enable paste from panel' and 'Enable restyling from panel' [language file entries 480 - 481]
- new autoindent alternative [Ctrl+Shift+Tab] : like Ctrl+Tab but all comments on lines with code are set to same column as the first line (and much more if 'Optimize code indentation' is activated) [language file entry 475]
- option 'Optimize code indentation' for [Ctrl+Shift+Tab] [language file entry 476]
- new folding style options in Files\Preferences\Style/Editor [language file entries 470-474]
- new option 'Save source(s) before Compile/Run or Compile/Debug' enabled by default [language file entry 477]
Oui, comme annoncé sur le forum anglais, scintilla ne synchronise pas une 'view' pour les marqueurs de 'folding', il faudrait gérer ces évènements en double, et je ne sais pas si çà en vaut la peine.Dräc a écrit :Il y a simplement quelques mises au point, car lorsque l’on plie des lignes de codes, l’affichage n’est pas synchronisé dans l’onglet, vis et versa.
Sauf si on compile avec jaPBeCoolman a écrit :Petit info, la compilation echoue avec des messages en rapport avec des variables constantes inexistantes, pour compiler jaPBe avec la version 3.94
Il y a une DLL de scintilla dans le répertoire \Compilers de PB4 (la renommer en scilexer.dll)Coolman a écrit :Lors du lancement, un autre message d'ereur en rapport avec les dlls de scintilla
Oui, ce n'est pas simple !Coolman a écrit :En attendant, je salue le travail de gnozal parce que le code source est un vrai bazar sauf peut etre pour l'auteur initial
Code : Tout sélectionner
;##############################################
;
; Swiss Ephemeris - swedll32.LIB
;
; Interface pour Purebasic 4.0.x
;
; ftp://ftp.astro.com/pub/sweph/
; http://www.astro.com/swisseph/swephprg.htm
;
;##############################################
#SEFLG_JPLEPH=1
#SEFLG_SWIEPH=2
#SEFLG_MOSEPH=4
#SEFLG_SPEED=256
#SEFLG_HELCTR=8
#SEFLG_TRUEPOS=16
#SEFLG_J2000=32
#SEFLG_NONUT=64
#SEFLG_NOGDEFL=512
#SEFLG_NOABERR=1024
#SEFLG_EQUATORIAL=2048
#SEFLG_XYZ=4096
#SEFLG_RADIANS=8192
#SEFLG_BARYCTR=16384
#SEFLG_TOPOCTR=32768
#SEFLG_SIDERAL=65536
#SEFLG_HELCTR=8
#SEFLG_TRUEPOS=16
#SE_CALC_RISE=1
#SE_CALC_SET=2
#SE_CALC_MTRANSIT=4
#SE_CALC_ITRANSIT=8
#SE_ECL_NUT=-1
Dim x.d(6); déclaration du tableau x
Dim x2.d(6)
Dim cusp.d(13)
Dim ascmc.d(10)
Dim attr.d(20)
Dim tret.d(20)
Dim geopos.d(10)
Dim geoposx.d(10)
Dim xnasc.d(6)
Dim xndsc.d(6)
Dim xperi.d(6)
Dim xaphe.d(6)
Dim Position.d(12)
Dim NomPlanete.s(9)
serr.s=""
hcusps.d=0
pName.s=Space(256)
Enumeration 0 Step 1
#SE_GREG_CAL
#SE_JUL_CAL
#ID
EndEnumeration
Enumeration 0 Step 1
#SE_SUN
#SE_MOON
#SE_MERCURY
#SE_VENUS
#SE_MARS
#SE_JUPITER
#SE_SATURN
#SE_URANUS
#SE_NEPTUNE
#SE_PLUTO
EndEnumeration
Enumeration
#SPR_Terre
#SPR_OmbreTerre
#SPR_Lune
#SPR_OmbreLune
EndEnumeration
Restore planetes
For n=0 To 9
Read NomPlanete.s(n)
Next n
;##############################################
Import "swedll32.lib"
JulDay.d(annee.l,mois.l,jour.l,heure.d,flag.l) As "_swe_julday@24"
RevJul(juliandate.d,flag.l,*annee.l,*mois.l,*jour.l,*heure.l) As "_swe_revjul@28"
Day_Of_Week.l(juliandate.d) As "_swe_day_of_week@8"
DegNorm.d(Angle.d) As "_swe_degnorm@8"
Date_conversion.l(annee.l,mois.l,jour.l,heure.d,cal.b,tjd.d) As "_swe_date_conversion@28"
Calc_ut.l(tjd.d,ipl.l,Iflag.l,*x,serr.s) As "_swe_calc_ut@24";il ne faut pas mettre x sous forme de tableau. ????
get_planet_name(ipl.l,pName.s) As "_swe_get_planet_name@8"
deltat.d(tjd.d) As "_swe_deltat@8"
pheno.l(tjd.d,ipl.l,Iflag.l,*attr,serr.s) As "_swe_pheno@24"
rise_trans.l(tjd.d,ipl.l,starname.s,epheflag.l,rsmi.l,*geopos,atpress.d,attemp.d,*tret,serr.s) As "_swe_rise_trans@52"
houses_ex.l(tjd.d,Iflag.l,geolat.d,geolon.d,ihsy.l,*cusp,*ascmc) As "_swe_houses_ex@40"
sidtime.d(tjd.d) As "_swe_sidtime@8"
houses_armc.l(armc.d,geolat.d,eps.d,ihsy.l,*cusp,*ascmc) As "_swe_houses_armc@36"
EndImport
;##############################################
Macro myDEBUG(y,m,d,h)
"Le "+RSet(Str(d),2,"0")+"/"+RSet(Str(m),2,"0")+"/"+RSet(Str(y),4,"0")+" à "+StrD(h,2)
EndMacro
Macro DeciMinut(a)
Int(a)+(a-Int(a))*0.60
EndMacro
annee.l=Year(Date())
jour.l=Day(Date())
mois.l=Month(Date())
heure.d=Hour(Date())
minut.d=Minute(Date())
heure=heure+minut/60
; annee.l=2006
; jour.l=5
; mois.l=4
; heure.d=3
; minute=48
; seconde=0
heure=heure+minute/60+seconde/3600
lat.d=44.06
lon.d=4.47
glon.d=Int(lon)+((lon-Int(lon))*100)/60
glat.d=Int(lat)+((lat-Int(lat))*100)/60
geopos(0)=glon
geopos(1)=glat
geopos(2)=0
Iflag=#SEFLG_SWIEPH+#SEFLG_SPEED
tjd_ut.d=JulDay(annee,mois,jour,heure,#SE_JUL_CAL)
For nplanete=#SE_SUN To #SE_PLUTO
Calc_ut(tjd_ut,nplanete,Iflag,@x.d(0),serr.s); par contre là il faut mettre le tableau ????
Position(nplanete)=x(0)
Next nplanete
If ((Position(1)<Position(0) And Position(0)-Position(1)<180) Or (Position(1)>Position(0) And Position(1)-Position(0)>180))
Elong.s=" Ouest"
Else
Elong.s= " Est"
EndIf
tsid.d=sidtime(tjd_ut)
ecart.d=deltat(tjd_ut)
ecart.d=ecart.d*86400
tsid.d=tsid+glon/15
armc.d=tsid*15
pheno(tjd_ut,#SE_MOON,#SEFLG_HELCTR,@attr.d(0),serr.s)
Debug "Angle de Phase "+ StrD(attr(0),2)
Debug "Phase "+StrD(attr(1),2)
Debug "Elongation "+StrD(attr(2),2)+Elong
Debug "Diamètre Apparent "+StrD(attr(3),2)
Debug "Magnitude apparente "+StrD(attr(4),2)
rise_trans(tjd_ut,#SE_SUN,"",#SEFLG_SWIEPH,#SE_CALC_RISE,@geopos.d(0),1013,15,@tret.d(0),serr.s)
RevJul(tret(0), #SE_JUL_CAL,@annee.l,@mois.l,@jour.l,@heure.d)
Debug "lever du soleil "+myDEBUG(annee,mois,jour,DeciMinut(heure))
rise_trans(tjd_ut,#SE_SUN,"",#SEFLG_MOSEPH,#SE_CALC_SET,@geopos.d(),1013,15,@tret.d(0),serr.s)
RevJul(tret(0), #SE_JUL_CAL,@annee.l,@mois.l,@jour.l,@heure.d)
Debug "coucher du soleil "+myDEBUG(annee,mois,jour,DeciMinut(heure))
rise_trans(tjd_ut,#SE_MOON,"",#SEFLG_SWIEPH,#SE_CALC_RISE,@geopos.d(0),1013,15,@tret.d(0),serr.s)
RevJul(tret(0), #SE_JUL_CAL,@annee.l,@mois.l,@jour.l,@heure.d)
Debug "lever de la lune "+myDEBUG(annee,mois,jour,DeciMinut(heure))
rise_trans(tjd_ut,#SE_MOON,"",#SEFLG_MOSEPH,#SE_CALC_SET,@geopos.d(),1013,15,@tret.d(0),serr.s)
RevJul(tret(0), #SE_JUL_CAL,@annee.l,@mois.l,@jour.l,@heure.d)
Debug "coucher de la lune "+myDEBUG(annee,mois,jour,DeciMinut(heure))
Calc_ut(tjd_ut,#SE_ECL_NUT,0,@x.d(0),serr.s)
eps_true.d= x(0)
houses_armc(armc.d,glat.d,eps_true.d,Asc("P"),@cusp.d(0),@ascmc.d(0))
If OpenWindow(#ID, 0, 0, 800, 600, "Astrologie", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget) = 0 Or CreateGadgetList(WindowID(#ID)) = 0
End
EndIf
StartDrawing(WindowOutput(#ID))
DrawingMode(1)
For n=0 To 9
DrawText(10,50+pas,NomPlanete(n))
DrawText(80,50+pas,RSet(StrD(Position(n),2),6," "))
pas+20
Next n
pas=0
For n=1 To 12
DrawText(200,50+pas,"Maison "+Str(n)+" "+StrD(cusp.d(n),2))
pas+20
Next n
DrawText(200,10,"Domification Placidus")
DrawText(370,10,"Jour Julien "+StrD(tjd_ut))
StopDrawing()
done.l = #False
Repeat
event.l = WaitWindowEvent()
Select event
Case #PB_Event_CloseWindow
done = #True
Case #PB_Event_MoveWindow
Case #PB_Event_SizeWindow
Default
EndSelect
Until done = #True
;
CloseWindow(#ID)
DataSection
planetes:
Data.s "Soleil","Lune","Mercure","Venus","Mars","Jupiter","Saturne","Uranus","Neptune","Pluton"
EndDataSection
; IDE Options = PureBasic v4.00 - Beta 6 (Windows - x86)
; CursorPosition = 158
; FirstLine = 123
; Folding = -
; IDE Options = PureBasic v4.00 - Beta 7 (Windows - x86)
; CursorPosition = 114
; FirstLine = 75
; Folding = -
; IDE Options = PureBasic v4.00 - Beta 8 (Windows - x86)
; CursorPosition = 110
; FirstLine = 91
; Folding = -
; IDE Options = PureBasic v4.00 - Beta 9 (Windows - x86)
; CursorPosition = 220
; FirstLine = 178
; Folding = -
Code : Tout sélectionner
;##############################################
;
; Swiss Ephemeris - swedll32.DLL
;
; Interface pour Purebasic 4.0.x
;
; ftp://ftp.astro.com/pub/sweph/
; http://www.astro.com/swisseph/swephprg.htm
;
;##############################################
Enumeration 0 Step 1
#SE_JUL_CAL
#SE_GREG_CAL
EndEnumeration
;##############################################
Prototype.d SWE_JulDay(annee.l,mois.l,jour.l,heure.d,flag.l)
Prototype.l SWE_RevJul(juliandate.d,flag.l,*annee.l,*mois.l,*jour.l,*heure.l)
Prototype.l SWE_Day_Of_Week(juliandate.d)
Prototype.d SWE_DegNorm(Angle.d)
;##############################################
If OpenLibrary(1,"swedll32.dll")
JulDay.SWE_JulDay = GetFunction(1,"_swe_julday@24")
RevJul.SWE_RevJul = GetFunction(1,"_swe_revjul@28")
Day_Of_Week.SWE_Day_Of_Week = GetFunction(1,"_swe_day_of_week@8")
DegNorm.SWE_DegNorm = GetFunction(1,"_swe_degnorm@8")
Else
MessageRequester("Error!","Can't open library!",#MB_ICONERROR)
End
EndIf
;##############################################
Macro myDEBUG(y,m,d,h)
"Le "+RSet(Str(d),2,"0")+"/"+RSet(Str(m),2,"0")+"/"+RSet(Str(y),4,"0")+" à "+StrD(h,2)
EndMacro
;##############################################
jd1.d = JulDay(1988,1, 1,12.23,#SE_JUL_CAL)
Debug jd1
RevJul( jd1, #SE_JUL_CAL, @annee.l, @mois.l, @jour.l, @heure.d)
Debug myDEBUG(annee, mois, jour, heure)
;##############################################
jd2.d = JulDay(2006,2,16,14.00,#SE_GREG_CAL)
Debug jd2
RevJul( jd2, #SE_GREG_CAL, @annee.l, @mois.l, @jour.l, @heure.d)
Debug myDEBUG(annee, mois, jour, heure)
;##############################################
Select Day_Of_Week( jd2 )
Case 0: Debug "Lundi"
Case 1: Debug "Mardi"
Case 2: Debug "Mercredi"
Case 3: Debug "Jeudi"
Case 4: Debug "Vendredi"
Case 5: Debug "Samedi"
Case 6: Debug "Dimanche"
EndSelect
;##############################################
Debug DegNorm(375.33333)
;##############################################
; IDE Options = PureBasic v4.00 - Beta 3 (Windows - x86)
; CursorPosition = 74
; FirstLine = 11
; Folding = -
; HideErrorLog
Code : Tout sélectionner
Import "C:\Purebasic400\Program\PureZIP_O.lib"
...
EndImport