Quel est cet objet attendu sur Instr ?
Bonjour à toutes et à tous,
Le script hta ci dessous est lancé par un . bat de la forme :
xargu.hta "c:\xargu.hta" c:\toto
Pourquoi ce message d'erreur : "objet attendu"
sur la ligne zxi=InStr(3,argu,"c:"); ?
Je débute en vbs.
Merci pour votre aide ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| <head
<HEAD>
<TITLE>Concatener des documents PDF d'un dossier</TITLE>
<HTA:APPLICATION ID="oHTA"
APPLICATIONNAME="CctnPDF"
BORDER="thick"
BORDERSTYLE="normal"
CAPTION="yes"
ICON=""
MAXIMIZEBUTTON="yes"
MINIMIZEBUTTON="yes"
SHOWINTASKBAR="no"
SINGLEINSTANCE="no"
SYSMENU="yes"
VERSION="1.0"
WINDOWSTATE="normal"/>
<script>
/* This function also retrieves the value of the commandLine property,
which cannot be set as an attribute. */
function window.onload()
{
argu=oHTA.commandLine;
zxi=InStr(3,argu, "c:");
zxi=zxi+2;
doss=Mid(argu,zxi)
targ.innerText=doss;
}
</script>
<script type="text/javascript">
function coucou() {
alert(document.getElementById("targ").innerText);}
</script>
</head>
<body>
Test commandline
<div id="targ">
</div>
<br>
<input type="button" value="GO" onClick="coucou()">
</body> |