Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Charting error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Charting error

    I am attempting to create a chart based on data returned from an SQL statement built and run in an xbasic function.

    but when it returns from the xbasic function, I get this error : Error:Script:a5_wp_series_eval() line:12 Expected value
    I scrolled thru 50 pages of the documentation after putting this in the search and come up with nothing.
    What does this error mean?

    I have confirmed that the xbasic function is properly creating the data:

    31|001|07|08/10/2006|1|9�31|001|07|08/11/2006|3|51�31|001|07|08/12/2006|10|189�31|001|07|08/13/2006|1|20�31|001|07|08/02/2010|1|12�31|001|07|08/05/2010|1|17�31|001|07|08/06/2010|3|43�31|001|07|08/08/2010|1|6�31|001|07|08/18/2010|2|25�31|001|07|08/19/2010|10|136�31|001|07|08/22/2010|15|173�31|001|07|08/23/2010|8|99�31|001|07|08/24/2010|7|116�31|001|07|08/25/2010|5|52�31|001|07|08/27/2010|2|33�31|001|07|08/28/2010|4|48�31|001|07|08/29/2010|1|11�31|001|07|08/31/2010|1|19�31|001|07|09/03/2010|4|42�31|001|07|08/18/2011|1|17�31|001|07|08/22/2011|4|66�31|001|07|08/25/2011|171|1034�31|001|07|08/09/2012|2|24�31|001|07|08/07/2014|1|11�31|001|07|08/08/2014|1|19�31|001|07|08/10/2014|1|11�31|001|07|08/11/2014|2|30�31|001|07|08/15/2014|1|19�31|001|07|08/23/2014|2|15�31|001|07|08/24/2014|11|85�31|001|07|08/25/2014|5|31�31|001|07|08/27/2014|18|162�31|001|07|08/28/2014|2|40�31|001|07|08/10/2015|2|31�31|001|07|09/03/2017|2|20�31|001|07|08/03/2018|4|31�31|001|07|08/05/2018|5|25�31|001|07|08/07/2018|5|60�31|001|07|08/08/2018|10|84�31|001|07|08/15/2018|5|66�31|001|07|08/16/2018|10|98�31|001|07|08/24/2018|6|58�

    My data series is defined as
    Custom
    Xbasic function name : getdata
    Subseries names: tribe, species, area, timestrata, num_fish, num_lbs

    function getdata as C (e as p)
    '
    ' Description:
    ' Gets criteria (time strata, species, catch area, data source) from
    ' screen and builds SQL query to get data for chart
    '
    '=======================================================================
    '
    ' Revision History
    '
    ' Date Description of Modification
    ' 07/15/2021 Initial version
    '=======================================================================
    ' Arguments: e as Pointer to submitted record
    '
    ' Calls: none
    '
    ' Returns: string
    ' return value: list of values for chart
    '=======================================================================

    dim ls_timestrata as c
    dim ls_species as c
    dim ls_area as c
    dim ls_datasource as c
    dim ls_txt as c
    dim ls_tribe as c
    dim ls_select as c
    dim ls_from as c
    dim ls_where as c
    dim ls_group as c
    dim ls_order as c
    dim ls_begin_date as c
    dim ls_end_date as c

    dim ls_sql as c
    dim args as sql::Arguments
    dim cn as sql::Connection
    dim rs as sql::ResultSet
    dim connectflag as L
    dim resultflag as L
    dim goodflag as L

    debug(1)
    ' get criteria

    if eval_valid("e.datasubmitted.SHOW") = .F. then
    ls_datasource = "TOCAS"
    else
    ls_datasource = e.datasubmitted.SHOW
    end if

    if (ls_datasource = "TOCAS") then
    ls_from = " FROM tocas_dba.TOCAS_VIEW "
    else
    if (ls_datasource = "WAFT") then
    ls_from = " FROM tocas_dba.LIFT_VIEW "
    else ' ls_datasource = "ALL"
    ls_from = " FROM ALL_TICKET_VIEW "
    end if
    end if


    if eval_valid("e.datasubmitted.time_strata") = .F. then
    ls_timestrata = "Day"
    else
    ls_timestrata = e.datasubmitted.time_strata
    end if

    SELECT
    CASE ls_timestrata = "Day"
    ls_timeclause = "landing_date"
    CASE ls_timestrata = "Week"
    ls_timeclause = "mgmt_week"
    CASE ls_timestrata = "Month"
    ls_timeclause = "month(landing_date)"
    CASE ls_timestrata = "Year"
    ls_timeclause = "catch_year"
    CASE ELSE
    ls_timeclause = ls_break
    END SELECT

    if eval_valid("e.datasubmitted.begin_date") = .F. then
    ls_begin_date = "01/01/1970"
    else
    ls_begin_date = e.datasubmitted.begin_date
    end if

    if eval_valid("e.datasubmitted.end_date") = .F. then
    ls_end_date = "12/31/2100"
    else
    ls_end_date = e.datasubmitted.end_date
    end if

    if eval_valid("e.datasubmitted.TRIBE") = .F. then
    ls_tribe = SESSION.USER_TRIBE
    else
    ls_tribe = e.datasubmitted.TRIBE
    end if

    if eval_valid("e.datasubmitted.species") = .F. then
    ls_species = "001"
    else
    ls_species = e.datasubmitted.species
    end if

    if eval_valid("e.datasubmitted.catch_area") = .F. then
    ls_area = "07"
    else
    ls_area = e.datasubmitted.catch_area
    end if

    ' build query
    ls_select = "SELECT tribe_num, species_code, catch_area_code, " + ls_timeclause + " as timestrata, sum(rptd_cnt) as num_fish, sum(rptd_lbs_qty) as num_lbs "
    ls_where = "WHERE tribe_num = :whattribe and species_code = :whatspecies and catch_area_code = :whatarea"
    ls_where = ls_where + " and landing_date >= :startdate and landing_date <= :enddate "

    ls_group = " group by tribe_num, species_code, catch_area_code, " + ls_timeclause
    ls_order = " order by " + ls_timeclause + ", species_code, catch_area_code"

    ls_sql = ls_select + ls_from + ls_where + ls_group + ls_order
    debug(1)
    ' set arguments
    args.Add("whattribe", ls_tribe )
    args.Add("whatspecies", ls_species )
    args.Add("whatarea", ls_area)
    args.Add("startdate", ls_begin_date)
    args.Add("enddate", ls_end_date)

    ' run query and get data
    connectflag = cn.Open("::Name::TOCAS")
    cn.PortableSQLEnabled = .f.
    resultflag = cn.Execute(ls_sql, args)
    rs = cn.ResultSet
    ls_txt = ""
    goodflag = rs.nextRow()
    while goodflag
    ls_txt = ls_txt + rs.data(1) + "|" + rs.data(2) + "|" + rs.data(3)+ "|" + rs.data(4)+ "|" + rs.data(5)+ "|" + rs.data(6) + crlf()
    goodflag = rs.nextRow()
    end while

    cn.close()
    getdata = ls_txt

    end function ' getdata



    #2
    expected value usually means that you were using a function and did't close a paren or a close quote, or the function takes two parameters and you only provided one, or that you were combining text values with a + and forgot the +. Something like that.
    Pat Bremkamp
    MindKicks Consulting

    Comment


      #3
      when i define my data series xbasic function (in the Properties Data Series Builder) as getdata(e), I do not get the error, but it never calls the function. If I define it as getdata with no argument, I get the error after it calls the function, runs the SQL and gets the data (see above). It correctly puts the data in the format needed, but then fails to pass it back to create the chart.
      I pretty much copied the code from the example in the Video, except for the SQL statement itself. I am stumped. Could it be because one of my subseries is a date?

      Comment


        #4
        Fixed the problem. Needed to call refreshcart from a button.

        Comment

        Working...
        X