Gambas France BETA


Pas de compte ? Incription

impossible de lancer le script

1
AuteurMessages
Prokopy#1 Posté le 5/9/2010 à 02:46:00
Kinder PinguiSalut à tous,

Alors voilà, j'ai un petit problème : j'ai essayé de m'amuser avec les scripts Gambas, mais quand j'essaie de le lancer, gbs tourne en boucle.
Apparemment c'est dans les lignes 174 et 180 de la classe CComponent, la fonction s'appelle elle-même et donc part en boucle :

1
PUBLIC SUB CalcSortKey() DIM sComp AS STRING DIM sNeed AS STRING DIM hComp AS CComponent 'DEBUG ">>>";; Key If SortKey = 0 Then If Require.Count Or If Need.Count Then For Each sComp In Require hComp = All[sComp] If Not hComp Then Error "gbs3: warning: cannot find component "; sComp; " required by "; Me.Name Continue Endif If hComp <> Me Then hComp.CalcSortKey Next For Each sNeed In Need For Each hComp In All If hComp.Implement.Find(sNeed) >= 0 Then hComp.CalcSortKey Endif Next Next Endif Inc $iKey SortKey = $iKey Endif Debug "<<<";; Key;; "=";; SortKeyEnd


Et voici, pour ceux que ça intéresse, la sortie du Debug que j'ai réactivé :

1
CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.cairo = 2CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gui = 4CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.qt4 = 5CComponent.CalcSortKey.192: <<< gb.form = 6CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.gui = 4CComponent.CalcSortKey.192: <<< gb.qt4 = 5CComponent.CalcSortKey.192: <<< gb.chart = 7CComponent.CalcSortKey.192: <<< gb = 8CComponent.CalcSortKey.192: <<< gb.compress = 9CComponent.CalcSortKey.192: <<< gb.crypt = 10CComponent.CalcSortKey.192: <<< gb.db = 11CComponent.CalcSortKey.192: <<< gb.db = 11CComponent.CalcSortKey.192: <<< gb.db.firebird = 12CComponent.CalcSortKey.192: <<< gb.db = 11CComponent.CalcSortKey.192: <<< gb.form = 6CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.gui = 4CComponent.CalcSortKey.192: <<< gb.qt4 = 5CComponent.CalcSortKey.192: <<< gb.db.form = 13CComponent.CalcSortKey.192: <<< gb.db = 11CComponent.CalcSortKey.192: <<< gb.db.mysql = 14CComponent.CalcSortKey.192: <<< gb.db = 11CComponent.CalcSortKey.192: <<< gb.db.odbc = 15CComponent.CalcSortKey.192: <<< gb.db = 11CComponent.CalcSortKey.192: <<< gb.db.postgresql = 16CComponent.CalcSortKey.192: <<< gb.db = 11CComponent.CalcSortKey.192: <<< gb.db.sqlite2 = 17CComponent.CalcSortKey.192: <<< gb.db = 11CComponent.CalcSortKey.192: <<< gb.db.sqlite3 = 18CComponent.CalcSortKey.192: <<< __COMPONENT = 19CComponent.CalcSortKey.192: <<< gb.debug = 20CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.gui = 4CComponent.CalcSortKey.192: <<< gb.qt4 = 5CComponent.CalcSortKey.192: <<< gb.desktop = 21CComponent.CalcSortKey.192: <<< gb.eval = 22CComponent.CalcSortKey.192: <<< gb.eval = 22CComponent.CalcSortKey.192: <<< gb.eval.highlight = 23CComponent.CalcSortKey.192: <<< gb.form = 6CComponent.CalcSortKey.192: <<< gb.form = 6CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.gui = 4CComponent.CalcSortKey.192: <<< gb.qt4 = 5CComponent.CalcSortKey.192: <<< gb.form.dialog = 24CComponent.CalcSortKey.192: <<< gb.form = 6CComponent.CalcSortKey.192: <<< gb.settings = 25CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.gui = 4CComponent.CalcSortKey.192: <<< gb.qt4 = 5CComponent.CalcSortKey.192: <<< gb.form.mdi = 26CComponent.CalcSortKey.192: <<< gb.form.stock = 27CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.image = 1CComponent.CalcSortKey.192: <<< gb.gtk = 3CComponent.CalcSortKey.192: <<< gb.image = 1[...]


Vous l'aurez compris, la fin passe en boucle indéfiniment. :)

Je précise aussi qu'avant j'avais une erreur, j'ai du corriger plusieurs lignes en remplaçant toutes les lignes accédant à la propriété UserPath de l'objet Component (propriété qui n'existe pas) par sa vraie propriété Path.
La théorie, c'est quand on sait tout et que rien ne fonctionne.
La pratique, c'est quand ça marche mais qu'on ne sait pas pourquoi.
Quand la théorie rejoint la pratique, rien ne fonctionne et on ne sait pas pourquoi.
spheris#2 Posté le 5/9/2010 à 14:13:00
Prokopy,
es tu sur de ce test ?
If hComp.Implement.Find(sNeed) >= 0
je ne pense pas que cette variable passe au dessous de 0 d'ou une boucle infinie.
Prokopy#3 Posté le 5/9/2010 à 14:23:00
Kinder PinguiNon ça c'est pas mon code, c'est la fonction de gbs3 qui pose problème justement.
Mon code c'est un Print "Hello world !", rien de très effrayant.
Gambix planche déjà sur la résolution du problème (cf. la mailing-list). ;)
La théorie, c'est quand on sait tout et que rien ne fonctionne.
La pratique, c'est quand ça marche mais qu'on ne sait pas pourquoi.
Quand la théorie rejoint la pratique, rien ne fonctionne et on ne sait pas pourquoi.
spheris#4 Posté le 5/9/2010 à 21:20:00
Ok !
Alors si gambix est sur le coup alors...je m'incline !
Respect !
;) ;)
GarulfoUnix#5 Posté le 6/9/2010 à 21:40:00
By the wayGambix étant l'auteur de GBS, donc il ne peut que débugger aussi bien.
1