Alpha Video Training
Results 1 to 3 of 3

Thread: Debugger never hits debug point

  1. #1
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Debugger never hits debug point

    I have a function that looks like this:
    OPTION ENCRYPTED_TOKENS
    FUNCTION importXLSFile AS P (fileName AS C, batchNo as N)
    debug(1)

    I use interactive window to call the function
    ?importXLSFile("filename", 1)

    The debug point is never hit, and the application runs as usual. How can i debug this function?

    Any help is appreciated. Thanks.

  2. #2
    Volunteer Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,620

    Default Re: Debugger never hits debug point

    You might try commenting the Option statement out until you have it working, then see if it still works with the Option statement in effect.
    -Steve


  3. #3
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default Re: Debugger never hits debug point

    When creating a function, NEVER put any commands above the FUNCTION line. The only thing that should ever be above the FUNCTION line is comment lines. (Which includes the date/time info Alpha adds and a password line if you use one. You can also add all the comments you want but NOT any code.)

    Whenever there is any code above the FUNCTION line, Alpha won't recognize any changes made inside the function until you either rem out the stuff above the line or close the function in the code editor and re-open it. (Or maybe you have to close Alpha and re-open it. It's been so long I don't remember.)

    There is one situation where the changes will be recognized - if you click the lightning bolt in the code editor itself. BUT there is a better way....

    I used to put code above the FUNCTION line for testing purposes during development. This worked great when I clicked the lightning bolt (or pressed Ctrl-F5) but was a real pain because I kept forgetting to rem it out when testing in the Interactive Window or from a form.

    THE SOLUTION
    is very simple - put any "test code" below the END FUNCTION line.

    Your OPTION Encrypted_Tokens should be the first line of code inside the function. And note that I said the first line of code because it must come after any "Description:" line. You do know about description lines don't you?

    Oh, OK, since I can't find it in the Help files anywhere I'm sure most people don't know about description lines so here's the info:

    If a description line immediately follows the FUNCTION line in a global function, the description text will be displayed with the autocomplete text. (Although I don't believe it will display until A5 has been shut down and re-started. Again, I'm not sure if it's after the code editor is closed or A5 is closed.) The syntax for the description line is:

    FUNCTION myfunction as c (<arguments>)
    'Description:<description text>

    The description line is a comment line immediately following the FUNCTION line which must start with the word description followed by a colon. (Capitalization of the word description does not matter.) Any text after the colon will be displayed. In other words, it's usually best NOT to put a space after the colon - especially if the description text is long enough to word wrap. Only one line is allowed but if it is longer than one screen, it will word-wrap. (And, fwiw, I've created some that wrapped to 5-6 lines on a 1440x900 screen.)

Similar Threads

  1. Better debugger
    By jkukuda in forum Archived Wishlist
    Replies: 13
    Last Post: 01-21-2006, 09:21 PM
  2. Debugger wish
    By Jim Chapman in forum Archived Wishlist
    Replies: 4
    Last Post: 01-12-2006, 11:58 AM
  3. Debugger went away
    By richarddsmith in forum Alpha Five Version 5
    Replies: 4
    Last Post: 10-01-2002, 04:51 PM
  4. debug??
    By Becky McNichols in forum Alpha Five Version 4
    Replies: 2
    Last Post: 01-27-2001, 06:05 AM
  5. debug(1)
    By Leah O'Neill in forum Alpha Five Versions 2 and 3
    Replies: 1
    Last Post: 08-03-2000, 05:20 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
  •