SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jun 2006
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    how to get/set the next record from datapool when a FOR loop increments

    Hi,

    I want to call a function with in a for loop.but the function uses the same datapool as that as the For loop.how do i set/get the next x inside the function whenever the for loop increments??

    donít know how to set /get the next record from datapool when a FOR loop increments to next X

    the code is here..
    --------------------------------------------------
    '$Include "sqautil.sbh"
    '$Include "projheader1.sbh"

    Declare Function SCL_exfunction(x as integer)

    Sub Main

    Dim Result As Integer
    Dim x as Integer
    Dim dp as Long

    Dim Major_Prog AS String
    Dim Minor_Prog AS String
    Dim DOF_Name AS String

    'Open Datapool

    dp = SQADatapoolopen ("Split Budget Item")

    'Open CARS website
    Callscript "CARS Application Open"

    Browser NewPage,"HTMLTitle=TIME PORTAL SYSTEM;Index=0",""
    HTMLLink Click, "HTMLTitle=Reports;Index=0", ""
    Browser NewPage,"HTMLTitle=TIME PORTAL SYSTEM;Index=0",""
    HTMLLink Click, "HTMLTitle=Show Budget Setup Screen;Index=2", ""
    Browser NewPage,"HTMLTitle=BUDGET SETUP SCREEN;Index=0",""

    'Calling the Function

    Call SAL_exfunction

    For x = 0 to 1

    Call SQADatapoolFetch(dp)

    ComboBox Click, "Name=majorProgram", ""
    'Calling the value for Major Program from Ratio Budget Item Datapool
    Call SQADatapoolvalue(dp,1,Major_Prog)
    ComboListBox Click, "Name=majorProgram", "Text=" + Major_Prog


    ComboBox Click, "Name=MinorProgram", ""
    'Calling the value for Minor Program from Ratio Budget Item Datapool
    Call SQADatapoolvalue(dp,2,Minor_Prog)
    ComboListBox Click, "Name=MinorProgram", "Text=" + Minor_Prog


    ComboBox Click, "Name=DOFNames", ""
    'Calling the value for DOF Name from Ratio Budget Item Datapool
    Call SQADatapoolvalue(dp,3,DOF_Name)
    ComboListBox Click, "Name=DOFNames", "Text=" + DOF_Name


    'call the function which uses the same datapool
    CALL SCL_exfunction(x)

    HTMLDocument Click, "HTMLTitle=BUDGET SETUP MAPPING PROCESS;Index=0", "Coords=766,450"

    PushButton Click, "Name=strnewsave"
    Browser NewPage,"",""

    PushButton Click, "Name=streditoksave"
    Browser NewPage,"",""

    Next x

    Call SQADatapoolclose(dp)

    PushButton Click, "Name=streditoknosave"

    Browser NewPage,"HTMLTitle=BUDGET SETUP SCREEN;Index=0",""
    HTMLLink Click, "HTMLTitle=Return to Calendar Screen.;Index=0", ""

    Window CloseWin, "", ""

    End Sub

    Function SCL_exfunction(x as integer)

    Dim dp as Long
    Dim Process_Name1 AS String
    Dim PCA_Code1 AS String
    Dim Percentage1 AS String
    Dim Process_Name2 AS String
    Dim PCA_Code2 AS String
    Dim Percentage2 AS String

    'donít know how to set /get the next record from datapool when the FOR loop increments to next X
    'setfield (dp,1) or set x = get??

    'Open Split Budget Item Datapool
    dp = SQADatapoolopen ("Split Budget Item")

    Call SQADatapoolFetch(dp)

    ComboBox Click, "Name=ProcessNames1", ""
    Call SQADatapoolvalue(dp,7,Process_Name1)
    ComboListBox Click, "Name=ProcessNames1", "Text=" + Process_Name1


    ComboBox Click, "Name=PCACODES1", ""
    Call SQADatapoolvalue(dp,8,PCA_Code1)
    ComboListBox Click, "Name=PCACODES1", "Text=" + PCA_Code1


    EditBox Click, "Name=Percentage1", "Coords=4,9"
    Call SQADatapoolvalue(dp,9,Percentage1)
    InputKeys Percentage1


    ComboBox Click, "Name=ProcessNames2", ""
    Call SQADatapoolvalue(dp,10,Process_Name2)
    ComboListBox Click, "Name=ProcessNames2", "Text=" + Process_Name2


    ComboBox Click, "Name=PCACODES2", ""
    Call SQADatapoolvalue(dp,11,PCA_Code2)
    ComboListBox Click, "Name=PCACODES2", "Text=" + PCA_Code2

    EditBox Click, "Name=Percentage2", "Coords=3,12"
    Call SQADatapoolvalue(dp,12,Percentage2)
    InputKeys Percentage2


    HTML Click, "HTMLId=floatingmenu", "Coords=39,76"

    Call SQADatapoolclose(dp)

    End Function

  2. #2
    Member
    Join Date
    Feb 2006
    Location
    Gujarat, India
    Posts
    238
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to get/set the next record from datapool when a FOR loop increments

    Hi,

    To fetch the next data from the datapool the command SQADatapoolFetch can be used and you can write it just before the Next x statement so that it will get incremented before x

    I think this will work.

  3. #3
    Member
    Join Date
    Jun 2006
    Location
    Bangalore
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to get/set the next record from datapool when a FOR loop increments

    Hi! Colubia,

    If you are using the same Datapool in both for loop and the function, I thin it better if you declare all the variables that are related to Datapool in the header file and try to fetch all the variable within the for loop before going to function. As the variable are global declared it can be accessed in any function.
    So you need not call the Datapool once again in the function and also you need not bother about how to increment the for loop.

    I think this solves you problem.

    Regards
    Balasubramani
    Thanks and Regards
    Balasubramani

  4. #4
    Junior Member
    Join Date
    Jun 2006
    Posts
    10
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: how to get/set the next record from datapool when a FOR loop increments

    thx guys. i used global variable and it worked. have to try to use it as header file and pass the value to the function.

 

 

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 10.71%
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 01:46 AM.

Copyright BetaSoft Inc.