okay after too many hours my logic is falling short.
please look at this and see what I am missing here
I can not seem to get a proper result from my select case inside the loop. WHAT AM I MISSING????
thanks
Adam
(testing on xp and IE6)

code:
 BREAK ON
IF @inwin = 2
? "This script will not Run on a win9x system."
EXIT
ENDIF

$description = readvalue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters","srvcomment")

;--------------------------------------------------------


$title = "Update Computer Description"


;---------------- Instantiate Object --------------------

global $appie , $status
$appie = CREATEOBJECT("InternetExplorer.Application")

;---------------- load up html --------------------------


$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>

<HEAD>
<META NAME="generator" CONTENT="HTML Tidy, see www.w3.org">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<TITLE>$title</TITLE>
<STYLE TYPE="text/css">
<!---body{ background-color: blue; color: black;
font-family: tahoma, arial; font-size: 10pt; margin: 2px "
input.tbox { border: lpx black solid;}
td { font: 10pt tahoma; }
--->
</STYLE>
</HEAD>

<BODY SCROLL="no">
<CENTER>
<P ALIGN="center">Description
<BR>
Fill in all fields. Once you click submit the changes are made
<BR>
then you will see the description field get filled in.
<BR>
Then click the Close.</P>

<FORM name="frm">


<TABLE ALIGN="center">
<TR>
<TD ALIGN="right">Ip (info only):</TD>

<TD COLSPAN="2"><INPUT ID="ip" VALUE="123" CLASS="tbox"></TD>
</TR>

<TR>
<TD ALIGN="right">Description:</TD>

<TD COLSPAN="2">
<INPUT ID="id" VALUE="" CLASS="tbox" SIZE="60">
<HR>
do not type in the area above
</TD>
</TR>

<TD COLSPAN="2"><INPUT TYPE="hidden" id="status" VALUE="0"></TD>
</TR>

<TR>
<TD COLSPAN="2">
</TD>

<TD ALIGN="right">
</TD>
</TR>

<TR>
<TD ALIGN="right">

<INPUT ID="enter" TYPE="button" VALUE=" Submit " ONCLICK="frm.status.value=1">
<INPUT ID="close" TYPE="button" VALUE=" Close " ONCLICK="frm.status.value=2"> </TD></FORM>

<TD COLSPAN="2">
</TD>
</TR>
</TABLE>
</CENTER>
</BODY>
</HTML>'

;---------------- Set IE Object Properties --------------
$appie.top = 10
$appie.left = 300
$appie.height = 550
$appie.width = 550
$appie.addressbar = 0
$appie.menubar = 0
$appie.toolbar = 0
$appie.statusbar = 0
$appie.resizeable = 0
$appie.navigate("about:blank")


;-------------- load html ------------------
$appie.document.write($html)


WHILE $appie.busy <> 0 AND @error = 0
LOOP

;----------------Make IE visible and set focus -----------

$appie.visible = 1
WHILE setfocus("$title") <> 0
LOOP
;---------shorten up the path ----------
$doc = $appie.document

$status = ""
;---- write in your ip into the webpage-----

$appie.document.frm.ip.value =@ipaddress0
$appie.document.frm.id.value = $description

; Get the valueof the status control ...
$status = $appie.document.frm.status.value
? $Status
; Main Command Loop
;--- I want to make sure I am see the right thing
? $doc.frm.ip.value

debug off
? "pause before the loop"
get $

while $status = "0"
? "in loop status = $status "
select
case $status = "1"
? "submit was clicked"
get $x


case $status = "2"
? "Cancel was clicked"
goto Finish


endselect

; Get the valueof the status control ...

$status = $doc.frm.status.value

loop
;--------------- finish ----------------
:finish
debug off
? "final status=$status"

;---------------- Object cleanup ...
? "pause after loop"
GET $
;sleep 4
$appie.quit
$appie = ''
exit



[ 16. February 2003, 06:37: Message edited by: rollo ]