SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Aug 2003
    Location
    India
    Posts
    41
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Variables lose the value

    Hi all,
    I have come across a problem which peole have told me before but this is very funny yet complicated I feel.I have declared the variables for a Login.I am picking up the Username and Password from an external Excel sheet.

    Once a user logs in,he performs some transactions and than logs out.This continue for all the users in the Sheet.

    Now once I have assigned the value of Row and Column, i increment it for each subsequent row.My problem is the variable is losing the value in between after first run and it does not enter the loop as the Username has a null value.

    e.G:
    dim UserName
    dim UserName_Row
    din UserName_Column
    UserName_Row = 2
    UserName_Column = 2

    UserName = xlDataSheet.Cells(UserName_Row,UserName_Column)

    While UserName <> ""

    Perform transactions

    UserName_Row = UserName_Row + 1
    Wend

    But the loop works only for one User.One thing is the transaction code is pretty big and it has lot of inherent looping.Even variables inside that loop are losing values.

    I am unable to think of a solution for this.Please let me know if someone has confronted this issue before.

    Thanks in anticipation,
    Trace

  2. #2
    Member
    Join Date
    Apr 2003
    Location
    Texas, USA
    Posts
    92
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Variables lose the value

    You are not getting "UserName" again after the first iteration.

    Try this...

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
    Do
    UserName = &lt;get cell data here&gt;
    &lt;transaction&gt;
    UserRow = UserRow + 1
    Loop While UserName &lt;&gt; &quot;&quot;
    </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Hope that helps...
    krstcs

  3. #3
    Member
    Join Date
    Aug 2003
    Location
    India
    Posts
    41
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Variables lose the value

    Hi krstcs,
    Thanks a lot.Do While loop worked after eliminating some loops from my script.I did had to hard code column names earlier I was searching for the column but the code inside the main loop is working fine.Thanks a lot.

    Regards,
    Trace

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:16 PM.

Copyright BetaSoft Inc.