Alpha Video Training
Results 1 to 6 of 6

Thread: Value of argument is out of range

  1. #1
    Member
    Real Name
    Betty Hardin
    Join Date
    Feb 2009
    Posts
    348

    Default Value of argument is out of range

    Importing data from a txt file. This is the line of text that is being imported:

    "Cash: 0.00,Check: 0.00,total line discounts:,$0.00,Credit: 824.45,On Account: 0.00,sub total:,$784.52,Debit:0.00,Food Stamps: 0.00,Secondary Currency: 0.00,Gift Cards: 0.00,tax:,$39.93,Prepaid Deposit: 0.00,grand total:,$824.45"

    I am trying to get the payment method and amount paid from this:

    if word(ln,1) = "Cash" then
    vn_CA = val(right(word(ln,1,",",1),len(word(ln,1,",",1))-5))
    vn_CH = val(right(word(ln,2,",",1),len(word(ln,2,",",1))-6))
    vn_CR = val(right(word(ln,5,",",1),len(word(ln,5,",",1))-7))
    vn_OA = val(right(word(ln,6,",",1),len(word(ln,6,",",1))-11))

    vn_CA and vn_CH both work fine. vn_CR and vn_OA do not. The error that I am getting is "Value of argument is out of range".

    This code has worked fine for quite a while now ... and just stopped working. (I did have issues w/v10 build 3523 or whatever it was and have dropped back to 2736 - but still see that 'system add-ins' version is 3523)

    Any ideas?

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default Re: Value of argument is out of range

    The expressions seem to work fine here using build 2649_3513.

    Code:
    ln = "Cash: 0.00,Check: 0.00,total line discounts:,$0.00,Credit: 824.45,On Account: 0.00,sub total:,$784.52,Debit:0.00,Food Stamps: 0.00,Secondary Currency: 0.00,Gift Cards: 0.00,tax:,$39.93,Prepaid Deposit: 0.00,grand total:,$824.45"
    
    ?word(ln,1)
    = "Cash"
    
    vn_CA = val(right(word(ln,1,",",1),len(word(ln,1,",",1))-5))
    ?vn_ca
    = 0
    
    
    vn_CH = val(right(word(ln,2,",",1),len(word(ln,2,",",1))-6))
    ?vn_ch
    = 0
    
    
    vn_CR = val(right(word(ln,5,",",1),len(word(ln,5,",",1))-7))
    ?vn_cr
    = 824.45
    
    
    vn_OA = val(right(word(ln,6,",",1),len(word(ln,6,",",1))-11))
    ?vn_OA
    = 0
    Either there's something wrong with your build, or an error is occurring elsewhere in your script. You might try closing Alpha Five and rebooting your machine.

    -- tom

  3. #3
    Member
    Real Name
    Betty Hardin
    Join Date
    Feb 2009
    Posts
    348

    Default Re: Value of argument is out of range

    Did that.

  4. #4
    Member
    Real Name
    Betty Hardin
    Join Date
    Feb 2009
    Posts
    348

    Default Re: Value of argument is out of range

    Found it. 2 records in the import file with bad data.

  5. #5
    Member
    Real Name
    Betty Hardin
    Join Date
    Feb 2009
    Posts
    348

    Default Re: Value of argument is out of range

    Thank you!

  6. #6
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,620

    Default Re: Value of argument is out of range

    Betty

    Glad that you found the issue with your imported data.

    Importing data is a difficult process. Too many things can be surprises and lead to unexpected situations.

    Alpha has some tools to help.

    Open a default browse of the imported data and do some quick analysis.

    1. Sort each field ascending and descending to see the values at their extremes. Unexpected characters tend to be at the highest or lowest values of a column - especially in a numeric field.

    2. While a column is highlighted - click tools - field statistics to see more information about the data.

    3. Expect unique values in a column? Verify with delete duplicate records utility - control panel - tables/sets tab - right click table name - utilities - delete duplicate records. This doesn't have to actually delete the records, but can help you identify if dupes exist.

    4. Summary operations can easily total a group of columns which can be used to cross check with the data source to show that all data was imported properly.

    Hope that helps.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

Similar Threads

  1. Argument in Report
    By gaby_h in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 12-24-2008, 07:50 PM
  2. Value of argument is out of range - A5V4
    By BruceA5V4 in forum Alpha Five Version 4
    Replies: 2
    Last Post: 01-24-2008, 01:37 PM
  3. Invalid Argument
    By Kevin McDuff in forum Alpha Five Version 5
    Replies: 4
    Last Post: 06-16-2003, 09:04 AM
  4. Argument is Incorrect...
    By Sean Tucker in forum Alpha Five Version 4
    Replies: 2
    Last Post: 07-19-2002, 03:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •