From: PaulHews
|
On: 2007/05/27 14:31:27
|
The code: xDebugPrint "currFrame: " & currFrame & " TotalFrames: " & TotalFrames & " TotalFrames > 0 And currFrame < TotalFrames: " & (TotalFrames > 0 And currFrame < TotalFrames)
The output: currFrame: 9 TotalFrames: 277 TotalFrames > 0 And currFrame < TotalFrames: False
|
|
From: Pino Carafa
|
On: 2007/05/27 14:46:12
|
Try:
(TotalFrames > 0) And (currFrame < TotalFrames)
|
|
From: Pino Carafa
|
On: 2007/05/27 14:46:47
|
Methinks it might be evaluating
TotalFrames > (0 And currFrame) < TotalFrames
|
|
From: PaulHews
|
On: 2007/05/27 19:31:26
|
Yeah, that was my first thought too. Nope.
The problem was actually the way I was setting the current frame variable initially: StartFrame = document.getElementById("ctl00_ContentPlaceHolder1_lblStartFrame").getAttribute("value")
See the problem?
Now for the mind bender. Save this as a vbs file and run it.
Dim currFrame currFrame = "9" Dim TotalFrames TotalFrames = 277 MsgBox currFrame < TotalFrames
MsgBox "9" < 277
Isn't that just wrong?
|
|
From: Pino Carafa
|
On: 2007/05/28 01:40:33
|
|
Bwah. That's just vile.
|
|
From: hes
|
On: 2007/05/31 10:03:51
|
|
LOL
|
|
|
From: Baldrick
|
On: 2007/06/06 00:30:54
|
Nasty!
|
|
From: PaulHews
|
On: 2007/06/07 14:43:34
|
Well, I'm done with that page, and the lessons learned are:
- Have a Q&D method to dump variables to a debug output of some kind.
- Use javascript where possible, because VBScript is shit. (Had to use VBScript for a lot of functions for compatibility with the God-awful ActiveX control we are using for camera + video.)
- When there's an error you can't figure out, it's probably because your variables are the wrong type. Or because you mistyped something and the variable doesn't exist. Or it may just be that the universe hates you.
- Visual Studio debugging of browser scripts actually works pretty well--most of the time. Best with javascript, because you can use the debugger key word to act as a breakpoint. Sometimes you can set an actual breakpoint, but I haven't figured out when it's allowed and when it isn't.
|
|
From: hes
|
On: 2007/06/07 15:00:46
|
|
If all that fails format the development pc and start over :)
|
|
From: PaulHews
|
On: 2007/06/10 08:33:40
|
If I was doing client side script more frequently, it might not be like I reformmated my brain every time...
|
|
From: PaulHews
|
On: 2007/06/10 08:33:54
|
|
This conversation is now closed.
|
|