

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
2 messages in org.openoffice.fr.prog[prog] erreur d'execution dans une bo...| From | Sent On | Attachments |
|---|---|---|
| Herve Benoit-Chieux | Dec 13, 2004 2:20 am | |
| Herve Benoit-Chieux | Dec 13, 2004 3:15 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | [prog] erreur d'execution dans une boucle : cusuer.gotorange | Actions... |
|---|---|---|
| From: | Herve Benoit-Chieux (hbc....@laposte.net) | |
| Date: | Dec 13, 2004 2:20:15 am | |
| List: | org.openoffice.fr.prog | |
bonjour à tous désolé pour la longueur du message et mon côté mégadébutant
je cherche à automatiser la transformation de formules mathématiques en un seul
clic en m'appuyant dur dmaths:
usages : - frappe au km - transformation de textes générés automatiquement (c'est l'usage essentiuel)
principe : chaque expression se trouvant entre #form et #ule est transformé
point 1 : j'ai écrit une procédure qui le réalise pour chaque (=> transformule
2)
point 2 : lorsque je veux itérér le principe, il y a une erreur d'execution sur
un cuseur.gotorange (voir transformule3) lots de la deuxième itération
même en mettant en place une procedure faisant appel à transformule2 , le pbm se
pose toujours de la même façon
d'avance merci de votre aide Hervé voici les procédures : **** transformule3 : procédé itéré : erreur lors de la deuxième itération = Sub transformule3 Dim vDescriptor, vFound1 , vFound2 dim cursor1,cursor2, cursor3 as object
rem détermination de la place des extrémités de la formule
Doc = ThisComponent ' Création d'un descripteur depuis un document susceptible de recherches vDescriptor = ThisComponent.createSearchDescriptor() With vDescriptor ' Tout ceci est "false" par défaut .SearchWords = true .SearchCaseSensitive = False End With Do ' chercher le début vDescriptor.SearchString = "#form" vFound1 = ThisComponent.findFirst(vDescriptor) If IsNull(vFound1) Then Print "Fin de la transformation !" Exit Do else Cursor1 = ThisComponent.getText().createTextCursorByRange(vfound1.end) ' Chercher la fin vDescriptor.SearchString = "#ule" vFound2 = ThisComponent.findFirst(vDescriptor) Cursor2 = vFound2 vFound2.goleft(4,true) Cursor1.gotoRange(Vfound2, True) rem détermination de la selection cursor3 = thiscomponent.CurrentController.getViewCursor() cursor3.gotostart(false) cursor3.gotorange(Vfound2,false) ==> cursor3.gotorange(Cursor1,true) <== c'est ici !! rem mise en formule writeformula rem effacement des indicateurs cursor3.gotostart(false) vDescriptor.SearchString = "#form" vFound1 = ThisComponent.findFirst(vDescriptor) vFound1.setstring("") vDescriptor.SearchString = "#ule" vFound2 = ThisComponent.findFirst(vDescriptor) vFound2.setstring("") end if Loop End sub
*********** celle qiu marche à chaque appel Sub transformule2 Dim vDescriptor, vFound1 , vFound2 Dim cursor1,cursor2, cursor3 as object
rem détermination de la place des extrémités de la formule ' création du curseur
' Création d'un descripteur depuis un document susceptible de recherches vDescriptor = ThisComponent.createSearchDescriptor()
With vDescriptor ' Tout ceci est "false" par défaut .SearchWords = true .SearchCaseSensitive = False End With ' Chercher le début vDescriptor.SearchString = "#form" vFound1 = ThisComponent.findFirst(vDescriptor) Cursor1 = ThisComponent.getText().createTextCursorByRange(vfound1.end) ' Chercher la fin vDescriptor.SearchString = "#ule" vFound2 = ThisComponent.findFirst(vDescriptor) Cursor2 = vFound2 vFound2.goleft(4,true) 'remettre le curseur juste avant #ule Cursor1.gotoRange(Vfound2, True) rem détermination de la selection cursor3 = ThisComponent.CurrentController.getViewCursor() cursor3.gotostart(false) cursor3.gotorange(Vfound2,false) cursor3.gotorange(Cursor1,true) rem mise en formule writeformula rem effacement des indicateurs cursor3.gotostart(false) vDescriptor.SearchString = "#form"
' effacer le début vFound1 = ThisComponent.findFirst(vDescriptor) vFound1.setstring("") ' effacer la fin vDescriptor.SearchString = "#ule" vFound2 = ThisComponent.findFirst(vDescriptor) vFound2.setstring("")
End sub







