Alpha Video Training
Results 1 to 5 of 5

Thread: "false" value wont work

  1. #1
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,095

    Default "false" value wont work

    my script wont run with this

    check box is false

    Code:
    if e.DataSubmitted.task_done = "false" .and. e.DataSubmitted.task_docreq = "" then
    but will with these two

    check box is false

    Code:
    if e.DataSubmitted.task_done <> "true" .and. e.DataSubmitted.task_docreq = "" then
    check box is true

    Code:
    if e.DataSubmitted.task_done = "true" .and. e.DataSubmitted.task_docreq = "" then
    been on this for hours and can't figure it out.

  2. #2
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,334

    Default Re: "false" value wont work

    Is the value in task_done set to "true"? Or is it set to .T.?

  3. #3
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,095

    Default Re: "false" value wont work

    Quote Originally Posted by TheSmitchell View Post
    Is the value in task_done set to "true"? Or is it set to .T.?
    the checkbox is based on a logical field in a dialog, i didnt know the value in the field could be one of the two. i had tried .f. before.

  4. #4
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,334

    Default Re: "false" value wont work

    Quote Originally Posted by richard2007 View Post
    the checkbox is based on a logical field in a dialog, i didnt know the value in the field could be one of the two. i had tried .f. before.
    If you're treating the checkbox like a logical field, then you should probably be checking against .T. and .F., not "true" and "false". The confusion sets in when you mix JS and Xbasic terms in the same property sheet. "true" is javascript; .T. is xbasic. They mean the same thing and I'm pretty sure alpha is referencing the javascript value in the GUI when you're defining values for checks & radios and giving you the xbasic version on the server-side.

    It probably doesn't help much, either, if xbasic is implicity converting the string "false" and "true" to a logical value instead of issuing an error. A non-empty string should evaluate to .T. in all cases, which would explain why your = "false" never worked.

    Of course, this all depends. Is task_done a Logical type? Working Preview > Debug(1) right before it. Check the contents.

  5. #5
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,095

    Default Re: "false" value wont work

    sarah, thats good to know and may well help with some other problems i am having of a similiar nature.

Similar Threads

  1. e.rowData.data("fieldName") Doesn't Work
    By CJMcGrath in forum Application Server Version 10 - Web/Browser Applications
    Replies: 15
    Last Post: 09-28-2011, 09:52 PM
  2. "Find And Replace" Won't Work In Embedded Browse
    By drjgs200 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 1
    Last Post: 06-29-2009, 04:35 AM
  3. form.view("fName","","","center","center")
    By reynolditpi in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 07-15-2008, 12:37 AM
  4. "Add" and "Save" buttons don't stay on "Self" page
    By Scholin in forum Application Server Version 8
    Replies: 2
    Last Post: 02-05-2008, 08:50 AM

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
  •