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

Memo Fields

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

    Memo Fields

    I came across a small problem that perhaps someone has a workaround for. I need to provide my server users with a memo field to type notes in etc. At the same time, the memo field needs to be written to programatically when users log in, etc.

    I can't find out how to write to a memo field. I can write to an RTF Memo, but then A5 complains when I put this field on a grid for general writing purposes.

    Can anyone point me in the right direction on this?

    Thanks.

    #2
    Re: Memo Fields

    OK. Answered my own question.

    The answer is not to use RTF Memo fields. You can use regular memo fields for this.

    There is a bit of a trick to it however. You need to put your data into a text file and then append it.


    Code:
    dim info as c=time("0h:0m")+" - "+"Fire Coordinator "+alltrim(session.cfirstlast)+" logged in for duty."
    	t=table.open("[PathAlias.ADB_Path]\opstat.dbf")
    	query.filter="dtoc(opdate)=dtoc(date())"
    	t.query_create()
    
    	lfl="[PathAlias.ADB_Path]\fCoord.txt"
    	file.create(lfl,file_rw_exclusive)
    	
    	save_to_file(crlf()+info+crlf(),lfl,.F.)
    	
    	t.change_begin()
        t.information.memo_read_from_file(lfl, MEMO_APPEND)
    	t.change_end()
    	t.close()
    The first part of the code locates the desired record in the OPSTAT log. This dbf has two fields i.e. date and information. I then put the data into the info variable and write it to a new .txt file called fcoord.txt. Then I append it to the existing memo field.

    I hope this helps someone!

    Charlie

    Comment


      #3
      Re: Memo Fields

      Charlie

      Action scripting has another method to add to a memo field..

      Add text to memo is listed under all actions...

      Fill out an example and then look at the xbasic that is generated..
      Al Buchholz
      Bookwood Systems, LTD
      Weekly QReportBuilder Webinars Thursday 1 pm CST

      Occam's Razor - KISS
      Normalize till it hurts - De-normalize till it works.
      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
      When we triage a problem it is much easier to read sample systems than to read a mind.
      "Make it as simple as possible, but not simpler."
      Albert Einstein

      http://www.iadn.com/images/media/iadn_member.png

      Comment


        #4
        Re: Memo Fields

        Al,

        Not sure what you are talking about here. I am using a dialog2 and then writing to a memo field. There is no action scripting that works for this. The other thing that I wanted to point out was that the use of RTF Memo fields is fine to write to, but cannot be edited in a grid. I haven't tried HTML Memo, but for most applications where someone wants to have the user write notes about a particular item AND allow the user to add or modify those notes, the only method I see is to use regular memo fields and append in the manner I have given.

        Am I wrong?

        Comment


          #5
          Re: Memo Fields

          Charlie

          You are writing xbasic code - probably in the serverside aftervalidate event - although you didn't specify where the code is located.

          The action scripting I'm talking about is from the desktop side where you can generate the xbasic that can be used in the same event as your code is located...

          It's probably 'safer' code and faster than going out to an external file and coming back..

          Also what you haven't shown us is how the whole dialog that you have works.. So an example would fill in the gaps...
          Al Buchholz
          Bookwood Systems, LTD
          Weekly QReportBuilder Webinars Thursday 1 pm CST

          Occam's Razor - KISS
          Normalize till it hurts - De-normalize till it works.
          Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
          When we triage a problem it is much easier to read sample systems than to read a mind.
          "Make it as simple as possible, but not simpler."
          Albert Einstein

          http://www.iadn.com/images/media/iadn_member.png

          Comment


            #6
            Re: Memo Fields

            Hi Al,

            Far be it from me to quibble, but I just don't see how this code would be helpful to me. The code generated from the action scripting is related to a memo field on a form and looks for a place to enter the addition. I've inserted it here:

            Code:
            'Insert text into a memo field: 'Information' in  current window.
            Dim TextToInsert as c
            Dim InsertPos as n 
            TextToInsert = "here you go"
            TextToInsert = crlf()+TextToInsert 
            TextToInsert = TextToInsert  + crlf()
            InsertPos = -1
            
            Dim TempObj as p
            dim readonly_flag as l	
            'Get a pointer to the Object on the Form/Browse that has the memo field.
            TempObj = obj(parentform.name(16)+":"+"Information")
            'Check if the RTF memo is readonly
            readonly_flag = TempObj.field.readonly
            if readonly_flag = .t. then 
            	ui_msg_box("Error","Cannot insert text into Memo field '"+"Information"+"' because it is read-only",UI_STOP_SYMBOL)
            	end 
            else
            	Dim MemoText  as c 
            	MemoText = TempObj.text
            	If InsertPos = 1 then 
            		MemoText = TextToInsert + MemoText 
            	Else if InsertPos = -1 then 
            		MemoText = MemoText + TextToInsert
            	Else
            		MemoText = substr(MemoText,1,InsertPos - 1 ) + TextToInsert + substr(MemoText,InsertPos)
            	End If 	
            	
            	'Now set the Memo field's text property to the next text..
            	TempObj.text = MemoText
            	
            	'Now activate the memo
            	tempobj.activate()
            	'...and set the insertion point in the memo field after the inserted text
            	if InsertPos = -1 then 'inserting at end of field
            		tempobj.topparent.cursor_set(9999999)
            	else
            		tempobj.topparent.cursor_set(InsertPos + len(TextToInsert))
            	end if 
            end if

            I respect your opinion as you have helped me on any number of occasions, but I just don't see it. I have made my code work, but the interesting thing is that I am getting stray Ascii characters in the memo field. Strange behavior or bad code on my part?

            Charlie

            Comment


              #7
              Re: Memo Fields

              Action scripting can be used as a basis for other code.

              In this case it's not exactly what you need, but shows you the methods to use and modify for your use.
              Al Buchholz
              Bookwood Systems, LTD
              Weekly QReportBuilder Webinars Thursday 1 pm CST

              Occam's Razor - KISS
              Normalize till it hurts - De-normalize till it works.
              Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
              When we triage a problem it is much easier to read sample systems than to read a mind.
              "Make it as simple as possible, but not simpler."
              Albert Einstein

              http://www.iadn.com/images/media/iadn_member.png

              Comment

              Working...
              X