Alpha Video Training
Page 2 of 2 FirstFirst 12
Results 31 to 41 of 41

Thread: x basic and action scritping

  1. #31
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default Re: x basic and action scritping

    Hi Ken,
    Quote Originally Posted by forskare View Post
    Why does AS incerts the %%? Perhaps it's a bug. You might want to explore that a bit more.

    .......It only means the environment has been changed and a correction must be made.
    Whether you know it or not, you have indicated a real important difference.

    When you have a piece of code in XBasic, it's code is always the same each time you open it up for editing. This is not true for action script code.

    The moment you load an action script and open up any action, the action script dialog settings are evaluated and new code is generated. So let's say you created in release "X", but are now editing in release "Y". Saving the AS will generate the code per the new releases' AS generating code. So even if you did not change anything, a small edit of an AS line followed by a save, can result in potentially different (and untested) code!

    A similar thing could occur in the way a function works in an Xbasic piece of code operates, but at least with XBasic code, your code would not have changed! Also, it is much less likely that a function would change in a bad way in what it does, versus the code that AS might generate.

    So, one could argue that the prudent thing to do would either change the code to XBasic so that it will not change, or make sure the underlying Xbasic code you start with, is the code you end with (except for your changes) when you edit in a new release.
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture



  2. #32
    "Certified" Alphaholic
    Real Name
    Gaby Hernandez
    Join Date
    Sep 2008
    Posts
    1,170

    Default Re: x basic and action scritping

    Ken: I love AS, without it I would be lost in space.

  3. #33
    "Certified" Alphaholic
    Real Name
    Raymond Lyons
    Join Date
    Apr 2000
    Location
    Carlsbad, CA
    Posts
    2,140

    Default Re: x basic and action scritping

    Quote Originally Posted by forskare View Post
    ....
    Why does AS incerts the %%? Perhaps it's a bug. You might want to explore that a bit more.
    I guess this is really for Gaby H:

    Note that the release notes indicate that Build 2053-3256, 26 Feb had a number of fixes/changes related to email functions. If you got the %% when you patched to this build, that would make it even more plausible to suspect a new bug. It should be easy enough to test. Just go back to an earlier version to verify what happens there with an AS created button. Then come back to Build 2053-3256 (or later) and try it again. If you still get the %%, that is enough reason to submit a bug report even if it should turn out that something else is going on, perhaps related to Outlook. Just try to make your bug report clear and detailed enough that they can repeat the problem.

    By the way, no one said AS is 100% reliable, but for somewhat different reasons neither is Xbasic coding. In any case, I have at least one very old app (circa v4) that has lots of AS in it and it is still chugging along with virtually no need yet to go back and fix AS things that no longer work. Admittedly, part of that is luck though because things do change (for example, Cancel() used to work differently than it does now in certain contexts--and it is not AS per se!).

  4. #34
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: x basic and action scritping

    I read about %% substitution for the @ problem in a thread a long time ago (version 8 and could have even been version 7)...and it happens in version 8 consistently using AS. I thought it was reported at that time and even if it had been and subsequently fixed, it could have been broken again with a patch. I too recommend another bug report for this.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  5. #35
    "Certified" Alphaholic forskare's Avatar
    Real Name
    Ken Nordin
    Join Date
    Apr 2000
    Location
    Walker, MN
    Posts
    7,545

    Default Re: x basic and action scritping

    Quote Originally Posted by csda1 View Post
    When you have a piece of code in XBasic, it's code is always the same each time you open it up for editing. This is not true for action script code.

    The moment you load an action script and open up any action, the action script dialog settings are evaluated and new code is generated. So let's say you created in release "X", but are now editing in release "Y". Saving the AS will generate the code per the new releases' AS generating code. So even if you did not change anything, a small edit of an AS line followed by a save, can result in potentially different (and untested) code!
    Hello Ira,

    Thanks for the insight. I was not aware that AS generated the code each time it is run. I thought that once the code was generated, that was it. I will be doing things just a weeeeee bit differently.

    kenn

  6. #36
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: x basic and action scritping

    This also clears up possibly some causes of user problems when just the simple conversion of an AS to xbasic or completely recreating the AS cures the problem when just modifying the current errant AS code will not. Good thing this doesn't happen on a regular basis!! Definitely something to keep in mind.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  7. #37
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default Re: x basic and action scritping

    Hi Kenn,

    Quote Originally Posted by forskare View Post
    Thanks for the insight. I was not aware that AS generated the code each time it is run. I thought that once the code was generated, that was it. I will be doing things just a weeeeee bit differently.
    Just to be clear, it is not when you run it, it is when it is being edited.

    It is regenerated when you open an action line in an action script for editing and click finish (but not when you hit cancel while editing the line). I believe it only regenerates the current edited action script line, so the other action script lines are probably not (95% certainty) regenerated. You'll know it's been regenerated, because you'll see an asterisk next to the code's tab. When you do a save of the code's tab, is is saved in the database's dictionary.
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture



  8. #38
    "Certified" Alphaholic
    Real Name
    Raymond Lyons
    Join Date
    Apr 2000
    Location
    Carlsbad, CA
    Posts
    2,140

    Default Re: x basic and action scritping

    Quote Originally Posted by csda1 View Post
    ....
    Just to be clear, it is not when you run it, it is when it is being edited....
    Which, in this regard means it does not make much if any difference whether one uses AS or Xbasic. Clearly if one edits an AS line, one surely is going to test it to make sure it still does what is desired, no?

    This whole discussion reminds me of something I alluded earlier in this thread: From one release (including patch updates) to another many things other than AS code can and do change. For example, a few years ago one could prevent a red X click from closing a form by simply putting "Cancel()" in the form's CanExit event, forcing the user to click a button that did something prior to coming to parentform.close() which then closed the form. Then at some point either the details of what Cancel() does changed or what happens when a CanExit event fires changed and from then on even parentform.close() would not close the form (as it probably never should have, i.e., that it did was probably a bug that was eventually fixed).

    The point is that it is not just the coding behind AS that may change from time to time, virtually anything is subject to change. Which means if you are looking for something that is 100% reliable in the sense that it will always and forever work, AS coding is hardly the only thing that is going to disappoint you. To repeat, new users should use AS both to accomplish things and, by converting AS to Xbasic, as a good way to learn Xbasic and especially Xdialog. And no, I did not say this was the only way to learn Xbasic or that the Xbasic code generated by AS is as good as can be done. But it is a tremendous tool in the Alpha Five toolkit.

    Raymond Lyons

  9. #39
    "Certified" Alphaholic forskare's Avatar
    Real Name
    Ken Nordin
    Join Date
    Apr 2000
    Location
    Walker, MN
    Posts
    7,545

    Default Re: x basic and action scritping

    Quote Originally Posted by Raymond Lyons View Post
    Which, in this regard means it does not make much if any difference whether one uses AS or Xbasic. Clearly if one edits an AS line, one surely is going to test it to make sure it still does what is desired, no?

    This whole discussion reminds me of something I alluded earlier in this thread: From one release (including patch updates) to another many things other than AS code can and do change. For example, a few years ago one could prevent a red X click from closing a form by simply putting "Cancel()" in the form's CanExit event, forcing the user to click a button that did something prior to coming to parentform.close() which then closed the form. Then at some point either the details of what Cancel() does changed or what happens when a CanExit event fires changed and from then on even parentform.close() would not close the form (as it probably never should have, i.e., that it did was probably a bug that was eventually fixed).

    The point is that it is not just the coding behind AS that may change from time to time, virtually anything is subject to change. Which means if you are looking for something that is 100% reliable in the sense that it will always and forever work, AS coding is hardly the only thing that is going to disappoint you. To repeat, new users should use AS both to accomplish things and, by converting AS to Xbasic, as a good way to learn Xbasic and especially Xdialog. And no, I did not say this was the only way to learn Xbasic or that the Xbasic code generated by AS is as good as can be done. But it is a tremendous tool in the Alpha Five toolkit.

    Raymond Lyons
    :) Well said!!! :)

    kenn

  10. #40
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default Re: x basic and action scritping

    Hi Raymond,

    Quote Originally Posted by Raymond Lyons View Post
    Which, in this regard means it does not make much if any difference whether one uses AS or Xbasic. Clearly if one edits an AS line, one surely is going to test it to make sure it still does what is desired, no?
    Despite the surface appearance that they are the same, they are actually radically different. A function (Alpha's or a user's UDF has code that is syntactically compiled without errors (otherwise it would never be able to be used) and tested for what it is.

    Some AS actions are very simple and straightforward. These seldom have issues, as there is almost a 1 to 1 correspondence to the XBasic code they generate. Others actions generate code from many selections of menus and settings. These generate a string of code that needs to be compiled (which Alpha does when you save it) without errors, and more importantly makes sense for all the settings. While, in general, each setting (or multiple settings) of an action script builds a portion of the code, there is no way every combination of possible codes could ever be fully tested. Some parts can be very straightforward to generate (and to test - this is why it generally works) and other parts depend on multiple settings which can be a nightmare to generate and can create extremely complex code.

    In most cases, there is a very specific code generation sequence where you take setting "A", generate it's code, take setting "B" append it's generated code and so forth. But then there are cases where "B" implies what "A" generates, and where it needs to be located in the code, and so forth. It can get so intertwined, that it's impossible to totally predict what it will or could generate and these are where the typical failures tend to be.

    That doesn't negate the usefulness of AS, but it does significantly increase the chance of generated code that won't work because of the settings.
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture



  11. #41
    "Certified" Alphaholic forskare's Avatar
    Real Name
    Ken Nordin
    Join Date
    Apr 2000
    Location
    Walker, MN
    Posts
    7,545

    Default Re: x basic and action scritping

    Quote Originally Posted by csda1 View Post
    Hi Raymond,



    Despite the surface appearance that they are the same, they are actually radically different. A function (Alpha's or a user's UDF has code that is syntactically compiled without errors (otherwise it would never be able to be used) and tested for what it is.

    Some AS actions are very simple and straightforward. These seldom have issues, as there is almost a 1 to 1 correspondence to the XBasic code they generate. Others actions generate code from many selections of menus and settings. These generate a string of code that needs to be compiled (which Alpha does when you save it) without errors, and more importantly makes sense for all the settings. While, in general, each setting (or multiple settings) of an action script builds a portion of the code, there is no way every combination of possible codes could ever be fully tested. Some parts can be very straightforward to generate (and to test - this is why it generally works) and other parts depend on multiple settings which can be a nightmare to generate and can create extremely complex code.

    In most cases, there is a very specific code generation sequence where you take setting "A", generate it's code, take setting "B" append it's generated code and so forth. But then there are cases where "B" implies what "A" generates, and where it needs to be located in the code, and so forth. It can get so intertwined, that it's impossible to totally predict what it will or could generate and these are where the typical failures tend to be.

    That doesn't negate the usefulness of AS, but it does significantly increase the chance of generated code that won't work because of the settings.
    :D WHEW!!!

Similar Threads

  1. Visual Basic to x basic
    By jkukuda in forum Alpha Five Version 7
    Replies: 1
    Last Post: 12-11-2005, 09:14 AM
  2. Tutorial on new Action in Action Scripting
    By Selwyn Rabins in forum Alpha Five Version 5
    Replies: 14
    Last Post: 12-15-2002, 04:36 PM
  3. A5V5beta-viewing X-basic-action scripts
    By Ohlen Cartmell in forum Alpha Five Version 4
    Replies: 4
    Last Post: 07-05-2002, 02:41 PM
  4. X-Basic....Help
    By fairviewcomputing in forum Alpha Five Version 4
    Replies: 10
    Last Post: 02-04-2002, 02:14 PM
  5. First try using x-basic
    By ggreb in forum Alpha Five Version 4
    Replies: 11
    Last Post: 12-23-2000, 06:33 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
  •