Alpha Video Training
Results 1 to 7 of 7

Thread: Date dialog script & report script won't combi

  1. #1
    Member
    Real Name
    John Bierman
    Join Date
    Sep 2000
    Posts
    35

    Default Date dialog script & report script won't combi

    When I atttempt to combine two scripts which will run fine standing alone, the combined script halts after completing the first script:

    'SCRIPT 1 - Prompt for a date and store result in a variable called 'Daily'

    dim global Daily as D
    dim prmpt_title as c
    dim prmpt_default as c
    prmpt_title = "Enter the date for the report"
    prmpt_default = "today()"
    Daily = ui_get_date_calendar(prmpt_title,prmpt_default)


    'SCRIPT 2 - View a preview of the report

    query.filter = ""
    query.order = ""
    :Report.Preview("Daily time",query.filter,query.order)

    I have tried a "play a sound" script as the second script with the same result. Therefore, it would seem that the problem rests with the first script.

    What am I overlooking?

    John

  2. #2
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Date dialog script & report script won't c

    How have you "combined" the two scripts?

    Have you pasted the two into a third script (script3)?

    Have you created a third script which runs the first two as follows:

    script_play("script1")
    script_play("script2")

    Are you sure an "end" command isn't lurking around somewhere in between the two?

    Bill

  3. #3
    Member
    Real Name
    John Bierman
    Join Date
    Sep 2000
    Posts
    35

    Default RE: Date dialog script & report script won't c

    Bill:

    These scripts are used "on Push" with a menu button. They were created using the script genie for xbasic.

    Thanks for tanking a look.

    John

  4. #4
    "Certified" Alphaholic
    Real Name
    Peter Wayne
    Join Date
    Apr 2000
    Posts
    1,728

    Default RE: Date dialog script & report script won't c

    ui_get_date_calendar returns a character variable, not a date one. your first script dies when you try to stuff the return value into your global date variable, "daily".

  5. #5
    Member
    Real Name
    John Bierman
    Join Date
    Sep 2000
    Posts
    35

    Default RE: Date dialog script & report script won't c

    Dr. Wayne:

    It is an honor to have you respond. I find your work invaluable to my humble efforts with Alpha. My application relies on your example at page 230 of your book. I have script that uses the dialog box to obtain a start and end date.

    I do get confused with the date functions. I don't understand why I am able to get a date value with the dialog box, set it as a global variable and then run a report that filters my records by date values.

    I supsected the problem was a mismatch of variables and I tried to convert the date using your example: Daily = ctod(dtoc(Daily))is what I ended up using. Am I writing this correctly? I not sure about the placement of this language but I cannot get it to work.

    Thanks for your assistance. When I use the message board I try to make my query useful to others like myself who are learning the program (although I have been working with Alpha since A4V2)

    John

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Date dialog script & report script won't c

    What the good doctor said was

    Character Result_String = UI_GET_DATE_CALENDAR( Title as C, Default_Date_String as C )

    so your

    Daily = ui_get_date_calendar(prmpt_title,prmpt_default)

    needs to be

    Daily = ctod(ui_get_date_calendar(prmpt_title,prmpt_default))

    Also prmpt_default = "today()" seems to be incorrect

    try

    prmpt_default = "date()"

    today() in not currently a valid Alpha function.

  7. #7
    Member
    Real Name
    John Bierman
    Join Date
    Sep 2000
    Posts
    35

    Default RE: Date dialog script & report script won't c

    Stan:

    Thanks for making the complicated simple. The addition of six characters is all that was needed!

    Where I was getting confused is that the script created by the genie with the addition of "dim global Daily as D" did in fact create a date variable which Alpha would recognize -just not in the script itself.

    I hope my troubles will be educational to others.

    The time you all have taken is greatly appreciated. The future of Alpha software is dependent upon the support of knowledgeable persons such as yourself and all who took time to help.

    John

Similar Threads

  1. A4 to A5V6 - Useful Dialog Script
    By cpc@technonet.com in forum Alpha Five Version 6
    Replies: 9
    Last Post: 12-31-2004, 07:18 AM
  2. Dialog script problems in V7
    By Bill Louis in forum Alpha Four Versions 7 and 8
    Replies: 10
    Last Post: 12-28-2003, 06:55 AM
  3. Closing a form within dialog script
    By Rodney Efird in forum Alpha Five Version 5
    Replies: 3
    Last Post: 02-06-2003, 05:48 PM
  4. Calling script from Dialog box
    By magdin in forum Alpha Five Version 5
    Replies: 2
    Last Post: 01-10-2003, 12:17 PM
  5. dialog script help
    By Tom Patten in forum Alpha Five Version 4
    Replies: 4
    Last Post: 06-30-2002, 06:58 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
  •