Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1298 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  Aide Vbscript type incompatible.

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Aide Vbscript type incompatible.

n°1300609
alfredino
Posté le 07-02-2006 à 16:12:11  profilanswer
 

Bonjour,  
Je suis un débutant en Vbscript.  
Je récupére une chaine de caracteres dans arrServiceList(i). J'essaye d'ecrire arrServiceListe(0) dans un fichier.  
je met dans le code MyFile.Write arrServiceList(i) mais ca me rend l'erreur type incompatible.  
 
Aidez moi SVP

mood
Publicité
Posté le 07-02-2006 à 16:12:11  profilanswer
 

n°1300625
mareek
Et de 3 \o/
Posté le 07-02-2006 à 16:22:42  profilanswer
 

poste ton code, c'est difficile de te donner la raison d'une erreur sans le code.


---------------
"I wonder if the internal negative pressure in self pumping toothpaste tubes is adjusted for different market altitudes." John Carmack
n°1300639
alfredino
Posté le 07-02-2006 à 16:37:35  profilanswer
 

voila le code
 
CreateAfile
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject" )
Set objTextFile = objFSO.OpenTextFile _
    ("C:\Documents and Settings\user\Bureau\Dev_SMS\TestSMS\Nouveau\Ack1.txt", ForReading)
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    arrServiceList = Split(strNextLine , " " )
    Wscript.Echo "Server name: " & arrServiceList(0)
    For i = 1 to Ubound(arrServiceList)
        Wscript.Echo "Service: " & arrServiceList(i)
    Next
Loop
 
Sub CreateAfile
   Dim fso, MyFile
   Set fso = CreateObject("Scripting.FileSystemObject" )
   Set MyFile = fso.CreateTextFile("C:\Documents and  
 
Settings\user\Bureau\Dev_SMS\TestSMS\Nouveau\testfile.txt", True)
   MyFile.Write arrServiceList(1)
MyFile.Close
End Sub

n°1300644
mareek
Et de 3 \o/
Posté le 07-02-2006 à 16:41:32  profilanswer
 

ça te fait une erreur parce que "arrServiceList" est vide au moment ou tu fais "MyFile.Write arrServiceList(1)"


---------------
"I wonder if the internal negative pressure in self pumping toothpaste tubes is adjusted for different market altitudes." John Carmack
n°1300646
alfredino
Posté le 07-02-2006 à 16:50:49  profilanswer
 

C'est quoi la solution ?

n°1300647
mareek
Et de 3 \o/
Posté le 07-02-2006 à 16:54:55  profilanswer
 

A quoi sert la procedure CreateAfile ?


---------------
"I wonder if the internal negative pressure in self pumping toothpaste tubes is adjusted for different market altitudes." John Carmack
n°1300655
alfredino
Posté le 07-02-2006 à 17:10:22  profilanswer
 

C bon. En fait il fallait appeler creaAfile apres la fonction.


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  Aide Vbscript type incompatible.

 

Sujets relatifs
[VBScript] PING + PORTDemande d' aide sur les pointeurs
Besoin d'aide pour création d'interface graphique[oracle] Expression du mauvais type
Aide pour développer avec delta3Daide inseré gif sur photo
[VBScript] [RESOLU] fenetre qui se ferme automatiquement[PHP] - Aide : Expression Régulière
Vbscript qui ne se ferme pas !! (wscript.quit ne fonctionne pas)Information aide bulle jaune : Possible ?
Plus de sujets relatifs à : Aide Vbscript type incompatible.


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR