Wrox Programmer Forums
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 23rd, 2006, 05:02 PM
Authorized User
 
Join Date: Feb 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADSystemInfo

What is wrong with this code?

<p><script type=text/vbscript language=vbscript>
        set objnet=createobject("ADSystemInfo")
        set struser=objnet.username
        set count1=1
        do until right(struser,1)=chr(44)
          set strname=left(struser,count1)
          count1 = count1+1
        loop
        document.write("Welcome " + strname)
        </script></p>
When I take out the loop stuff and do document.write("Welcome " + objnet.username) the distinquished name shows on my page but when the above code is added nothing shows at the top of my page.

seeker55

Reply With Quote
  #2 (permalink)  
Old May 1st, 2006, 06:26 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Did you get this resolved?

What is happening here is that the last value in the loop is occupying the variable, and this is probably not the one you want. Is there a better way to get this variable? Why do you need a loop?



mmcdonal
Reply With Quote
  #3 (permalink)  
Old August 20th, 2008, 11:32 AM
Registered User
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sbrbot
Default

Infinite loop!

Reply With Quote









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.