Carobit Logo
Valid HTML 4.01!

Your Connection
  guest
Log out
Log in or Sign Up
Site Navigation
  Home
Forum Home
Closed Conversations
For Members
  Support
Feedback
Member Search
Carobit Mail
Helpful Links
  Smilies
Formatting
Preview
Originator: PaulHews Printable Version
Title: Why I hate script -- well one of the reasons anyway...
Back to

Attachments Add Attachment

History
From: Send Carobit Mail 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: Send Carobit Mail Pino Carafa On: 2007/05/27 14:46:12
Try:

(TotalFrames > 0) And (currFrame < TotalFrames)

From: Send Carobit Mail Pino Carafa On: 2007/05/27 14:46:47
Methinks it might be evaluating

TotalFrames > (0 And currFrame) < TotalFrames

From: Send Carobit Mail 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: Send Carobit Mail Pino Carafa On: 2007/05/28 01:40:33
Bwah. That's just vile.

From: Send Carobit Mail hes On: 2007/05/31 10:03:51
LOL

From: Baldrick On: 2007/06/06 00:30:54
[oh] Nasty!

From: Send Carobit Mail 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: Send Carobit Mail hes On: 2007/06/07 15:00:46
If all that fails format the development pc and start over :)

From: Send Carobit Mail 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... wink

From: Send Carobit Mail PaulHews On: 2007/06/10 08:33:54
This conversation is now closed.

Enter your comments here

As a guest you will only be able to see what a comment posted by you would look like by clicking the Preview button. You can't actually participate by posting comments to this conversation.

Number of viewers: 21