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

Revision

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

  • Stan Mathews
    replied
    RE: Revision

    Sorry, key bounce.

    Try changing all references for orders_new->revision to orders_new->revision.value

    Leave a comment:


  • Stan Mathews
    replied
    RE: Revision

    You can't use change_begin() because you're using "form methods", not "table" methods.

    orders_new->revision=orders_new->revision+"1"

    This will not increment the field.

    What happens in your script if orders_new->revision = 0 ? - nothing.

    "As soon as you change the value property of the revision field, the record is automatically placed in change mode."

    Try changein all references for orders_new->revision to orders_new->revision"v.value

    Leave a comment:


  • 7ZNJABB
    Guest replied
    RE: Revision

    Hi Stan,

    I hate to beat a sick horse to death, but I'd like you to review the
    following:

    if orders_new->revision>"0" then
    orders_new->revision=orders_new->revision+"1"
    elseif orders_new->revision=""
    orders_new->revision="0"
    end if

    When I initiate a new PO, it sets rev to 0, when I change or append a
    PO, an error message says "Not in the change or enter mode". This is
    pretty close to working, at least it finds orders_new->revision in both
    halves of the "IF/Elseif". Any ideas as to how to put the form in the change mode? I tried change.begin.
    efs

    Leave a comment:


  • 7ZNJABB
    Guest replied
    RE: Revision

    Sounds reasonable to me, I'll give it a go. Thanks for all of your
    time.
    efs

    Leave a comment:


  • Stan Mathews
    replied
    RE: Revision

    I think you should go back to Cal's suggestion about the cansave event and split up your script.

    You could place the first part

    if orders_new->revision="" then
    orders_new->revision="0"
    end if

    on the oninit and onfetch events for the form. This would just check the current record and place the "0" in the field if necessary.

    Then the second part would go in the cansave event to record "revisions".

    Leave a comment:


  • 7ZNJABB
    Guest replied
    RE: Revision

    Hi Stan,
    I finally see the logic problem with this. During the initial data
    entering of the PO, "rev" is obviously blank. But the first "if"
    statement places a zero in there. Now the second "if" statement would
    change the zero to a 1, meaning that there would never be a rev 0.

    Also, and this is weird, the event looks like this now:

    if orders_new->revision="" then
    orders_new->revision="0"
    end if
    if orders_new->revision.value="0" then
    orders_new->revision.value=str((val(orders_new->revision.value)+1),2,0)
    end if
    An error message says it can't find orders_new->revision, yet, if I
    comment out the bottom "IF" it works ok (obviously it can find it).

    efs

    Leave a comment:


  • 7ZNJABB
    Guest replied
    RE: Revision

    Looks like a double reverse, probably only needs 1 but I allowed 2

    efs

    Leave a comment:


  • Stan Mathews
    replied
    RE: Revision

    This works for me on form based on a table "test" field name "try". Try is single character field.
    if Try.value="" then
    Try.value= "0"
    end if

    if Try.value>="0" then
    Try.value= str((val(Try.value)+ 1),1,0)
    end if


    The next to last parameter in the str() statement (1 for mine)should match your field width.

    When I used Try.value + "1" it did not generate an error and I think it did increment, but "invisibly". The field is only one character wide, but Try.value + "1" tries to store "01" to the field and only the "0" goes in, so it looks as if nothing changed.

    Leave a comment:


  • Stan Mathews
    replied
    RE: Revision

    How many characters is your revision field capable of holding?

    Leave a comment:


  • 7ZNJABB
    Guest replied
    RE: Revision

    It still sets to zero initially, but does not increment, nor does it
    produce an error message.

    efs

    Leave a comment:


  • Stan Mathews
    replied
    RE: Revision

    Yes and no.

    tbl=table.open("c:program filesa5v4stoneorders_new")
    tbl.change_begin()

    opens an instance of the orders_new table and puts it into change mode.

    if orders_new->revision>="0" then - this is not the instance of orders_new that was opened previously.

    I'm paraphrasing the xbasic online doc's here- (search for "form methods")

    "As soon as you change the value property of the revision field, the record is automatically placed in change mode."

    So it should be

    if orders_new->revision="" then
    orders_new->revision="0"
    end if

    if orders_new->revision>="0" then
    orders_new->revision.value = orders_new->revision+"1"
    end if

    I think.

    Go back to my earlier post about your incrementation, "orders_new->revision+"1" does not increment the value in the field.

    Leave a comment:


  • 7ZNJABB
    Guest replied
    RE: Revision

    Hi Stan,

    I have the following in the "onarrive" event for the field on the form.
    The 1st "if" is working as it should by setting revision to 0 when the
    PO is initiated. I changed the second "IF" to appear inside of a change
    mode. Now it gives the error "Not in the change or enter mode".
    Doesn't the line "tbl.change_begin() put it in the change mode?


    if orders_new->revision="" then
    orders_new->revision="0"
    end if
    tbl=table.open("c:program filesa5v4stoneorders_new")
    tbl.change_begin()
    if orders_new->revision>="0" then
    orders_new->revision=orders_new->revision+"1"
    end if
    tbl.change_end(.t.)

    tbl.close()

    Leave a comment:


  • 7ZNJABB
    Guest replied
    RE: Revision

    Hi Guys,

    I got this halfway home. I put the following on the onarrive field
    event on the form.

    if orders_new->revision="" then
    orders_new->revision="0"
    end if

    it works great!
    but if I add:
    if orders_new->revision="0" then
    orders_new->revision=orders_new->revision+"1"
    end if

    It gives the error that I am "not in the change mode". So I put the 2nd "if" in the "onchange" event. It doesn't do anything there, but no error message.

    Any ideas?
    efs

    Leave a comment:


  • JohnZaleski
    replied
    RE: Revision

    Stan,
    I think you could do this if the field is numeric and you are on a form. This is untested:
    IF(numfield.value = 0 .or.numfield.value = math_nam,1,numfield.value + 1)
    John

    Leave a comment:


  • Stan Mathews
    replied
    RE: Revision

    Make sure your change to character "stuck". There should be no reason for that error based on your posted expression.

    There is a different problem with your expression.


    if(isblank("revision"),"0",revision+"1") will not "increment" the revision field, it will tack a "1" on the end of the character value. IOW "0000" will become "00001" and "0123" would become "01231".

    If you countinue with this approach you might try

    if(isblank("revision"),"0",str(val(revision)+1)) or something similar.

    Leave a comment:

Working...
X