Results 1 to 8 of 8
  1. #1

    Coding Issue - Any Pointers

    Hello all wondering if you can help - what iam trying to do is this.

    I have my datapool has loads of rows of numbers in.

    say my datapool opens for the first time and starts at row 1 and then once its processed it it writes the next row to the file where it is. so say a week passes and we want to run it again i want it to read the file see its on say row 30 now start at row 30 and carry on - so if the last one it done was row 60 it would write row 60 on the file which is does.

    what i find is the logic for the reading and writing works but when its actually in play its using random numbers and not following my code - any pointers ? hopefully that makes sense

    heres the code that provides that functionality


    Open myfile for Input As #1
    Input #1,var
    Close #1

    msgbox "VAR FROM READ = "&var

    dp = SQADatapoolOpen ("ireland2", TRUE, SQA_DP_SEQUENTIAL, FALSE)

    'now loop down and fetch the information

    for i = 1 to var
    Call SQADataPoolFetch(dp) ' fetch the datapool

    next i

    Call SQADataPoolValue(dp,1,ES)

    InputKeys ES
    InputKeys "{ENTER}"
    InputKeys "{Enter}"

    'open to write to log of where we are for our row position

    Open myfile For Output As #1
    currentpos = var + 1
    Print #1,currentpos
    Close #1

    msgbox "CURRENTPOS FROM WRITE = "&currentpos

  2. #2

    Re: Coding Issue - Any Pointers

    I don't have problem running your code. the recorded cursor increments by 1 on each run.

    when you said it gave you random number, did you mean the number that was written into your rowset.txt file, or the number shown by your msgbox?


  3. #3

    Re: Coding Issue - Any Pointers

    hi larry

    right - heres what i can tell you

    it does increment by 1 that isnt the problem, in my datapool i have a load of numbers in desc order eg

    etc etc etc

    and i have master script i run say for example it was just called "master" and in master i have a call i use so say hyperthetically Call "test1" and IN test 1 i do the bits i need it to do and in test one there is the call to the script with the above code in.

    now i find that logic in my code above works fine but from the structure above its not using the sequence it could start at say 900899 and we know the next should be 900898 and for some reason it could go like 20 less eg 900872

    the txt file bit in the code above - eg open read it to a variable - get that row - and then increment by 1 and write it back works

    hope that makes sense



  4. #4

    Re: Coding Issue - Any Pointers

    ah, when jumping among multiple scripts, the cursor of DP might get messy. did you try SQADatapoolRewind() to force the cursor back to row 1? (you may want to put it after you open "ireland2" and before you start the loop of SQADataPoolFetch())


  5. #5

    Re: Coding Issue - Any Pointers

    thanks larry when i get five mins to try it ill wack it in and let you know the outcome

  6. #6

    Re: Coding Issue - Any Pointers

    works a treat now thanks for that - cant believe it only needed the rewind after that

  7. #7

    Re: Coding Issue - Any Pointers

    you know what? i once spent a whole hour debugging a code that readed some data and process it, and it turned out that the code crashed only because there was an extra cartridge return (new line) at the end of the input file (plain text) :-(


  8. #8

    Re: Coding Issue - Any Pointers

    always the way though isnt it fella - you cant see somethin , person x comes along says its "that" and you think god its so simple why didnt i see it

    always a simple thing



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:48 PM.

Copyright BetaSoft Inc.