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

Where is the property found for click column title sort?

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

    Where is the property found for click column title sort?

    I want to find out which column the user clicked to sort the browse for the child in a set based form. Anyone know where this can be found? I tried browse1.order_get() but it doesn't work for the child when in a set - is there another way to find out the current sort order for that table? I also tried vsort = topparent:tables:pay_reg.order_expression in the IW, but get nothing when the sort is changed.

    I know the old way was to use hot spots/buttons instead of column titles, but surely this "new" feature can be read somewhere!

    Thanks
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

    #2
    Re: Where is the property found for click column title sort?

    Up to V10 it was selectable in
    Column, title click behaviour on the browse tab of the browse properties window

    Has that changed?

    Added
    Oops - you asked about detecting the current order.
    I'll have a look as well.

    Comment


      #3
      Re: Where is the property found for click column title sort?

      Hi Ray,
      Actually there is probably a better way to go about this. I am trying to get a range of records selected in a browse and use that to filter the table so I can change a field in each of those records. I have the table initially in recno() order but this could be changed with a column title click before the user selects the records. But that shouldn't matter since my list will only have the records selected anyway. But now how do I filter the table so just those records can be fetched?

      Intial Order (recno() preferred):
      rng = browse1.selected_records()

      ?rng
      = 4830
      4831
      4832
      4833
      4834
      4835

      User changes the order:
      rng = browse1.selected_records()

      ?rng
      = 4862
      4787
      4858
      4861
      4859
      4864

      I tried a filter with "recno() = rng" but testing in the interactive it returned .f. ; also I tried is_recno_in(rng) and it also returned .f.
      I'm a bit weak on list processing functions...
      Robin

      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

      Comment


        #4
        Re: Where is the property found for click column title sort?

        So you want to loop through checking for record numbers in the string. Use this

        ?alltrim(str(recno(),12,0))$rng
        = .T.
        Added: you will need to qualify recno() to make sure it is the child table record.

        Comment


          #5
          Re: Where is the property found for click column title sort?

          if there is a possibilty that you check record number 13 and 513 is one of the selected numbers then that would return .T.
          Please use this instead to be 100% sure. (I use ptr. to represent the browse object or child table pointer whichever you use)
          Code:
          rn2=","+strtran(rng,crlf(),",")
          while ...
            if (","+alltrim(str(recno(),12,0))+",") $ (","+rn2+",")
              'make the changes to record
            end if
            [I]ptr[/I].fetch_next()
          end while

          Comment


            #6
            Re: Where is the property found for click column title sort?

            Here is what I came up with & a screenshot of the form - no query needed!

            Code:
            FUNCTION Add_Chk_nos AS C (begno = "" AS C )
            	'Pay_Reg->CHECKNO Numbering script
            	'gets range of records selected in browse for numbering
            	'the temp_pr table is initially alphabetically ordered by FILECODE
            	'when it is appended to this table
            		
            	on error goto ERRMSG2
            	DIM tbl as P 
            	tbl = table.get("pay_reg")
            	on error goto 0
            	
            	DIM begno as C
            	DIM endno as C
            	dim rng as C = "0"
            	dim LC as N
            	dim t1 as n
            	dim t2 as n
            	dim commit_flag as L 
            	
            	rng = browse1.selected_records()
            '	note as user selects the rows the last record becomes the first in the rng list
            	rng = sortsubstr(rng,crlf())
            '	trace.WriteLn("Records Selected: "+rng)
            	if begno = "" then
            		begno = ui_get_text("Add Check Numbers","First Check No.","")
            	end if
            '	LC = line_count(rng)-1
            '	endno = ltrim(str(val(begno)+LC))
            '	trace.WriteLn("Add Check Nos: "+alltrim(begno)+" to "+alltrim(endno))
            	dim qrec as n
            	t1 = toseconds(time())
            	tbl.batch_begin()
            		FOR EACH foo in rng
            			qrec = val(foo.value)
            			tbl.fetch_goto(qrec)
            			commit_flag = .t.
            			on error goto ERRMSG
            			tbl.change_begin()		
            				tbl.checkno = begno
            			tbl.change_end(commit_flag)
            			if commit_flag then
            				tln("Checkno Added",alltrim(begno))
            			end if
            			begno = increment_value(begno)
            		NEXT	
            	tbl.batch_end()
            	t2 = toseconds(time())
            	tln("Time elapsed",t2-t1)
            	ENDIT:
            	'topparent.show_all()
            	browse1.fetch_first()
            	Add_Chk_nos = rng
            	END
            	'
            	ERRMSG: 
            	commit_flag=.f.
            	script_play("ERRMSG")
            	on error goto 0
            	RESUME NEXT
            	'
            	ERRMSG2: 
            	ui_msg_box("Script Error","The PAY_REG table is not active",16)
            	end
            END FUNCTION
            Notice that the first 2 records in the browse are not part of the series for the current week's checks. That is because they are void entries for stop payments on lost checks. Previously I was just sorting the records and numbering them all together. But then when multiple checks or voids or replacement checks were introduced, I needed a way to select just a subset for numbering. By resorting the selection list (rng) I will not have the random sort I was hoping for, but so far it works pretty much as expected. If the selected records stayed in the order as they are highlighted - it would be perfect!
            Attached Files
            Last edited by MoGrace; 03-22-2013, 06:19 PM.
            Robin

            Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

            Comment


              #7
              Re: Where is the property found for click column title sort?

              Can't say I see an improvement.
              The first method could achieve exactly that, I like that one for simplicity.

              Comment


                #8
                Re: Where is the property found for click column title sort?

                To be honest Ray I didn't get the purpose of adding the "," at first. I will give it another go - concise code is ALWAYS better!
                Robin

                Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                Comment

                Working...
                X