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

Error Auto Writing to Memo Field

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

    Error Auto Writing to Memo Field

    I have an application that contains a Form with a Memo Field. This Memo Field is used as a log for changes to the record. When entering the Change mode of a record, I capture the values of various fields. Then when the record is saved a comparison is done for each field. If the field has been modified I add a line of text to the Memo Field used as a log. While testing this function out I found that it works quite well. However there seems to be a problem when the Memo Field reaches a certain size. Actually it�s when the variable that is trying to hold the contents of the Memo Field in the script that I�m using that has the problem. I used the action script builder to build my script then I converted it to xbasic. It looks like it reads the Memo Field into a variable and then adds the text that I want to add, then rewrites the field. I�m thinking a character buffer is getting overloaded or something along those lines. If you have written code using the action builder you will recognize the variables. The Error Dialog Box says:

    Script:auto-update-stat line:255
    TempObj:Text=MemoText
    TempObj:text subproperty cannot be assigned to

    Anyone have any ideas on how to correct this problem?

    Thanks in advance.

    Dale

    #2
    RE: Error Auto Writing to Memo Field

    I can't tell from the syntax whether

    TempObj:Text is an object or a property.

    Seems it should be

    TempObj.Text=MemoText
    (if tempobj is a field on a form)

    or

    TempObj:Text.text=MemoText
    (if tempobj:text is field on a form "tempobj")

    Depends on the context.
    There can be only one.

    Comment


      #3
      RE: Error Auto Writing to Memo Field

      Stan,

      TempObj is a pointer. The following dim statement is before the use of TempObj

      'Dim TempObj as p'

      TempObj is loaded by this line of code.
      'TempObj = obj(topparent.name(16)+":"+"Status_note")'

      Status note is the name of the Memo Field and MemoText is a character variable that is a combination of what is already in the field + A new line of text to be added.

      Dale

      Comment


        #4
        RE: Error Auto Writing to Memo Field

        So I think the first case applies. Alpha uses colons to separate parts of an object address. The period is used to "apply" methods and "refer" to properties.

        The text of the object "TempObj" is denoted by

        TempObj.text
        There can be only one.

        Comment


          #5
          RE: Error Auto Writing to Memo Field

          Yes,

          Your correct! I'm sorry, I didn't look close enough, the error dialog is:

          Script:auto-update-stat line:255
          TempObj.Text=MemoText
          TempObj.text subproperty cannot be assigned to

          Like I said, the script runs fine until the amount of characters being held in the variable gets too large.

          Dale

          Comment


            #6
            RE: Error Auto Writing to Memo Field

            Makes more sense now, at least to me. Doesn't get us any closer to a solution, though. Sorry.
            There can be only one.

            Comment


              #7
              RE: Error Auto Writing to Memo Field

              Dale,

              I have little experience with memo fields. However, two ideas occur:

              1) you could write the existing memo field text to a temp disk file, append the new text there, then import it back to the memo field. (while theoretically possible, this sounds very slow to me)

              2) you could rework the design of the application. Instead of using a single memo field to track all changes that might ever occur to the one record, use a simple table to track changes to the primary table, and write to it each time a change occurs. Each record in the 'change_log' table would contain the particulars on the change including: identifier for the record being changed, date changed, time changed, field name changed, identity of user, old field value, new field value.

              -- tom

              Comment


                #8
                RE: Error Auto Writing to Memo Field

                Tom,

                Your second option may work. But it does not explain why my script of adding text to a memo field works until it becomes a certain size, and then errors.

                Is the character buffer for a variable of a specific size?

                Dale

                Comment


                  #9
                  RE: Error Auto Writing to Memo Field

                  Dale, I don't know.

                  Since char type fields in tables are limited to 255 characters, and expressions are limited to 1024 characters, it would not surprise me to learn that char type variables are also limited to something less than available memory.

                  Have you tried counting characters to see where the problem crops up?

                  -- tom

                  Comment


                    #10
                    RE: Error Auto Writing to Memo Field

                    Tom,

                    It errors after 956, so I think you hit it with 1024 being the magic number. I wonder if this can be increased?

                    Until I get an answer I'll explore your other 2 ways of creating a change log.

                    Thanks,

                    Dale

                    Comment


                      #11
                      RE: Error Auto Writing to Memo Field

                      Does anyone know if this issue has been addressed?

                      I have a memo field that I would like to be able to add text to but not change or delete previous text. I created a button using an XDialog Box to enter the notes and then adding the variable along with date and user initials to the memo field. Works fine unless there are already alot of notes entered.

                      Comment


                        #12
                        RE: Error Auto Writing to Memo Field

                        Elke,

                        In reviewing the thread it seems the problem occurs when the memo field text is stored in a variable.

                        Is this necessary to do in the first place?

                        Have you tried working with a pointer to the memo field directly? Something like this:

                        tbl = table.current()
                        tbl.change_begin()
                        tbl.memo_field_name = tbl.memo_field_name + "Your new text"
                        tbl.change_end(.t.)

                        ???

                        -- tom

                        Comment


                          #13
                          RE: Error Auto Writing to Memo Field

                          I ran into this recently, and I was having the same problem.

                          a field on my form, say, is "LogNotes"
                          "LogNotes" is a memo field.

                          in a script, I say

                          lognotes.value="" 'recalculate from scratch - blank it
                          temp="" 'my character variable for storing the string in

                          temp="Changes Made to Parent:" + crlf()
                          temp=temp + changes1 + crlf()
                          temp=temp + changes2 + crlf()
                          lognotes.text=lognotes.text + (temp)
                          temp=""

                          temp=crlf() + "Changes Made to Child:" + crlf()
                          temp=temp + changes1 + crlf()
                          temp=temp + changes2 + crlf()
                          lognotes.text=lognotes.text + (temp)


                          I originally was saying lognotes.value + temp, but after about 25 lines, it bombed, but changing it to lognotes.text + temp fixed it
                          Cole Custom Programming - Terrell, Texas
                          972 524 8714
                          [email protected]

                          ____________________
                          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                          Comment


                            #14
                            RE: Error Auto Writing to Memo Field

                            Only works until the notes field has less than 1024 characters.

                            Comment


                              #15
                              RE: Error Auto Writing to Memo Field

                              Elke,

                              the example I gave, using a pointer to the currenty lengthy note field, works fine. It's not necessary to store the text of the current note field in a variable in order to extend it through concatenatioin with other text.

                              If you need an example of this let me know. I just built one that adds the same 65 character string to a memo field 50 times in a row.

                              -- tom

                              Comment

                              Working...
                              X