Error in GoFish5 in method: Method: GOFISH.FILLSEARCHRESULTSCURSOR

25 views
Skip to first unread message

KoenP

unread,
Jul 16, 2020, 11:57:45 PM7/16/20
to GoFish
Hi,
I am facing an error in my GoFish5: Message:      SQL: ORDER BY clause is invalid.
Trust the attached file gives an enough information how to settle this.
Anyone with a solution for this?
Thanks,
Koen


error_in_Gofish5.txt

Jim Nelson

unread,
Jul 17, 2020, 12:36:32 AM7/17/20
to foxpro...@googlegroups.com
Ignore the error. 

Then sort on different columns until the error disappears.  

Sent from my iPhone

On Jul 16, 2020, at 8:57 PM, KoenP <koen....@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxprogofish...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/foxprogofish/8c8f3474-ac7c-47b6-b509-cf0d78d88fb1o%40googlegroups.com.
<error_in_Gofish5.txt>

KoenP

unread,
Jul 17, 2020, 7:08:09 AM7/17/20
to GoFish
Hi Jim,
That is a little bit difficult for me:  which object contains that method? I am exploring the GoFish5.pjx file but cannot find the method FillearchResultCursor which to be changed. Remember my good old friend search engine GoFish does not work anymore. Would you be able to give e a clue where I can find that method please?
Stay healthy,
Koen

On Friday, July 17, 2020 at 6:36:32 AM UTC+2, Jim wrote:
Ignore the error. 

Then sort on different columns until the error disappears.  

Sent from my iPhone

On Jul 16, 2020, at 8:57 PM, KoenP <koen....@gmail.com> wrote:


Hi,
I am facing an error in my GoFish5: Message:      SQL: ORDER BY clause is invalid.
Trust the attached file gives an enough information how to settle this.
Anyone with a solution for this?
Thanks,
Koen


--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.

Matt Slay

unread,
Jul 17, 2020, 7:28:16 AM7/17/20
to foxpro...@googlegroups.com

Thar method is in the file "GoFish_Results.scx"


	PROCEDURE FillSearchResultsCursor

		Local lcCollate, lcField, lcOrderBy, lcSearchEngineResultsAlias, lcSearchResultsAlias
		Local lcSecondarySortField, lcSecondarySortOrder, lcSortField, lcSortOrder, lcTertiarySortField
		Local lcTertiarySortOrder, lnSelect, loColumn

		lcSearchEngineResultsAlias = Thisform.oSearchEngine.cSearchResultsAlias
		lcSearchResultsAlias = Thisform.cSearchResultsAlias

		lnSelect = Select()
		lcOrderBy = ''

		*** JRN 11/06/2015 : using !Empty(Field( to provide for case of changed field names in GF 5
		*-- Construct Order By clause for Select statement from stored form property
		If !Empty(Thisform.cSortField) and !Empty(Field(Thisform.cSortField, lcSearchEngineResultsAlias))
			lcSortField = Thisform.cSortField
			lcSortOrder = Thisform.cSortOrder
			If (Empty(lcSortOrder) or ('ASC' $ Upper(lcSortOrder)))
				lcSortOrder = 'ASC'
			Endif
			lcOrderBy = lcSortField + ' ' + lcSortOrder
		Endif

		If !Empty(Thisform.cSortFieldSecondary) and !Empty(Field(Thisform.cSortFieldSecondary, lcSearchEngineResultsAlias))
			lcSecondarySortField = Thisform.cSortFieldSecondary
			lcSecondarySortOrder = Thisform.cSortOrderSecondary
			If (Empty(lcSecondarySortOrder) or ('ASC' $ Upper(lcSecondarySortOrder)))
				lcSecondarySortOrder = 'ASC'
			EndIf
			lcOrderBy = lcOrderBy + ', ' + lcSecondarySortField + ' ' + lcSecondarySortOrder
		Endif

		If !Empty(Thisform.cSortFieldTertiary) and !Empty(Field(Thisform.cSortFieldTertiary, lcSearchEngineResultsAlias))
			lcTertiarySortField = Thisform.cSortFieldTertiary
			lcTertiarySortOrder = Thisform.cSortOrderTertiary
			If (Empty(lcTertiarySortOrder) or ('ASC' $ Upper(lcTertiarySortOrder)))
				lcTertiarySortOrder = 'ASC'
			EndIf
			lcOrderBy = lcOrderBy + ', ' + lcTertiarySortField + ' ' + lcTertiarySortOrder
		Endif

		If Empty(lcOrderBy)
			lcOrderBy = 'filename, class, name, methodname'
			thisform.cSortField = GetWordNum(lcOrderBy, 1, ',')
		Else
			lcOrderBy = Alltrim(lcOrderBy, 1, ',')
		EndIf

		Thisform.cOrderBy = lcOrderBy

		*-- Make header bold for primary sort column
		If Thisform.lInit
			For each loColumn in Thisform.oGrid.Columns
				loColumn.header1.FontBold = .f.
				lcField = GetWordNum(loColumn.ControlSource, 2, '.')
				If Upper(lcField) = Upper(GetWordNum(lcOrderBy, 1, ', '))
					loColumn.header1.FontBold = .t.
				Endif
			Endfor
		EndIf

		*-- This gives us case insensitive sorting...
		lcCollate = Set('Collate')
		Try
			Set Collate To 'General'
		Catch to loException

		EndTry

		lcOrderBy = lcOrderBy + ', filename, class, name, methodname, MatchStart'
		*-- Create the local cursor if it does not already exist -----------------------
		If !Used(lcSearchResultsAlias)
			Select * From (Select * From (lcSearchEngineResultsAlias) Order By &lcOrderBy) source;
			 Into Cursor (lcSearchResultsAlias) ReadWrite

		Else && Otherwise, Zap it and rebuild from GFSE cursor...

			Thisform.ClearSearchResultsCursor() && Zap it
			*-- Build a temp local cursor in correct initial order

			*TODO: The orderby clause here could fail since some field names were changed
			*      in relase 4.3.015. Need to handle this...
			Select * From (Select * From (lcSearchEngineResultsAlias) Order By &lcOrderBy) source ;
			 Into Cursor gf_temp_csr ReadWrite

			*-- Update local cursor in order that user has applied
			*!* ******************** Removed 11/09/2015 *****************
			*!* Insert Into (lcSearchResultsAlias) Select * From gf_temp_csr
			Select (lcSearchResultsAlias)
			Append from (Dbf('gf_temp_csr'))
		Endif

		Set Collate To (lcCollate)

		Select (lcSearchResultsAlias)
		Goto Top

		Select (lnSelect)



	ENDPROC

Matt Slay, President
Jordan Machine Co.
355 Clow Lane
PO Box 170339
Birmingham, AL 35217
Ph: 205-849-5050
Fx: 205-849-5075
matt...@jordanmachine.com
http://www.JordanMachine.com


To unsubscribe from this group and stop receiving emails from it, send an email to foxprogofish...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/foxprogofish/aefe6963-f252-4a5e-b363-5c244bd062c7o%40googlegroups.com.

Jim Nelson

unread,
Jul 17, 2020, 8:13:28 AM7/17/20
to foxpro...@googlegroups.com
Matt

I’m surprised you didn’t point him to the Settings file which is a text file somewhere where he could modify the sort fields. 

He shouldn’t need to go in and modify the code.  

Alternatively, I would think that when the error occurs he could suspend, set

lcOrderby = ‘Name’

And resume ... 

That would get him past the first bug, and then he could start sorting on any of the visible columns and repeat the whole process until the problem goes away.  



Sent from my iPad

On Jul 17, 2020, at 4:28 AM, Matt Slay <matt...@jordanmachine.com> wrote:



Koen Piller

unread,
Jul 17, 2020, 8:55:31 AM7/17/20
to GoFish
Jim,
I have numerous settings.dbf on my hd, would you be able where to find this one you are talking about.
Sofar I have not had any succes.
I do have 3 Gofish5.app files on my HD with also 3 gofish5.pjx files. Found the one which Thor is using, by renaming the one by one until Thor errored, than opened that one and changed on the method as follows, to start with:
SELECT * FROM (Select * FROM (lcSearchEngineResultsAlias)) source INTO CURSOR gf_temp_csr readwrite leaving the sorting clause completely out.
Rebuilt pjx and app, restarted VFP and to my disappointment, the error remains, what is more I can see in the debugger the changements by me are not present in the method, meaning there must be another GoFish5.app around. Now changed them all 3 and still error remains and changements are not seen. Something very funny going on over here.
When I than active Gofish5.app outside Thor, I do get the error. I suspend in the debugger, click on repair, I than do get an error "Containerwebcontrol" member is not found. Ignore and I am back into the method "FillSearchResultCursor" this time I can see the modifications I had made (excluding the sort order).
Would you believe I don't know anymore what to do,  how to solve it?
By the way this error is known to the original programmer showing his remark. Would it not be nice if someone could take the time to look into it?
My friends, any solution?
Stay healthy,
Koen



Op vr 17 jul. 2020 om 14:13 schreef Jim Nelson <jimrn...@gmail.com>:

Jim Nelson

unread,
Jul 17, 2020, 9:00:51 AM7/17/20
to foxpro...@googlegroups.com
Did you try my second suggestion?  You really should not have to modify any code.  

Alternatively, I would think that when the error occurs he could suspend, set

lcOrderby = ‘Name’

And resume ... 

That would get him past the first bug, and then he could start sorting on any of the visible columns and repeat the whole process until the problem goes away.  


Sent from my iPad

On Jul 17, 2020, at 5:55 AM, Koen Piller <koen....@gmail.com> wrote:



Koen Piller

unread,
Jul 17, 2020, 9:13:15 AM7/17/20
to GoFish
Jim,
The problem is I have too many settings files on my HD, it would take me hours to find the correct one, is it a txt or a dbf?
Stay healthy,
Koen

Op vr 17 jul. 2020 om 15:00 schreef Jim Nelson <jimrn...@gmail.com>:

Jim Nelson

unread,
Jul 17, 2020, 9:14:29 AM7/17/20
to foxpro...@googlegroups.com
Forget the search for the settings file.

Read my suggestion:


--
Jim Nelson

(805) 498-9195 (preferred)
(720) 837-3536 (cell)

KoenP

unread,
Jul 17, 2020, 9:59:43 AM7/17/20
to GoFish
Jim,
your suggestion to replace with Name works fine, thanks. But how to correct definitely, I cannot go on each and every time to replace and working with the debugger.
Stay healthy,
Koen

Op vrijdag 17 juli 2020 05:57:45 UTC+2 schreef KoenP:

Jim Nelson

unread,
Jul 17, 2020, 11:07:37 AM7/17/20
to foxpro...@googlegroups.com
After you resume you need to sort on one of the columns. 

The error will likely recur. 

Then sort on a different column.   

Repeat until there is no error. 

Sent from my iPhone

On Jul 17, 2020, at 6:59 AM, KoenP <koen....@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxprogofish...@googlegroups.com.

Mike Yearwood

unread,
Jul 17, 2020, 11:39:08 AM7/17/20
to foxpro...@googlegroups.com
Is this not the same error I fixed some months ago? Hasn't it been added to the main code?

KoenP

unread,
Jul 17, 2020, 11:40:49 AM7/17/20
to GoFish
Jim,
Did you read what I did? Remember I have 3(!) GoFish5.pjx and .app on my HD. Dont ask me why or howcome. I found which of the 3 is activated by Thor. There I changed the code by deleting the sortingorder completely. Bang error remained. The debugger showed no changes of the code. I ignored, and other error about not finding a file and bang the method where I changed the code appeared. This seems to indicate there is an other 4th GoFish5.app around but why it ends up with the one Thor is calling, it beats me completely. I can only find 3 files in which I changed in all the offending method. Or is Thor maybe, behind the scenes unzipping a GoFish5.app and removing again after close-down? I don't think so.
Presently the code reads an order by on: PROCCODE ASC, TRIMMEDMATCHLINE ASC, filename ASC, filename, class, name, methodname, MatchStart.  Please note 2x filename and also note fields  Also note it sorts on memo field Proccode ASC, characterfields and MatchStart=Integer. I did not know such a combination is allowed.
Maybe the best option is to download an re-install GoFish5 completely. Seems to be faster than to figure out which one of the 8 orderby components is causing an error.
Stay healthy,
Koen


On Friday, July 17, 2020 at 5:07:37 PM UTC+2, Jim wrote:
After you resume you need to sort on one of the columns. 

The error will likely recur. 

Then sort on a different column.   

Repeat until there is no error. 

Sent from my iPhone

On Jul 17, 2020, at 6:59 AM, KoenP <koen....@gmail.com> wrote:


Jim,
your suggestion to replace with Name works fine, thanks. But how to correct definitely, I cannot go on each and every time to replace and working with the debugger.
Stay healthy,
Koen

Op vrijdag 17 juli 2020 05:57:45 UTC+2 schreef KoenP:
Hi,
I am facing an error in my GoFish5: Message:      SQL: ORDER BY clause is invalid.
Trust the attached file gives an enough information how to settle this.
Anyone with a solution for this?
Thanks,
Koen


--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.

Jim Nelson

unread,
Jul 17, 2020, 11:42:25 AM7/17/20
to foxpro...@googlegroups.com
Well, if you're not going to follow my directions here, there's no reason for me to be involved.

Good luck.

To unsubscribe from this group and stop receiving emails from it, send an email to foxprogofish...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/foxprogofish/3b359e87-cfde-46d2-aa89-0c13e30b5d6do%40googlegroups.com.

KoenP

unread,
Jul 17, 2020, 11:44:10 AM7/17/20
to GoFish
Mike,
how did you fix? - unfortunately the link you posted in your message does not seem to point to your discussion, would you either review the link or upload the solution here?  Thanks!
Stay healthy,
Koen

Op vrijdag 17 juli 2020 17:39:08 UTC+2 schreef mikeyearwood:
Is this not the same error I fixed some months ago? Hasn't it been added to the main code?

On Fri, Jul 17, 2020 at 11:07 AM Jim Nelson <jimrn...@gmail.com> wrote:
After you resume you need to sort on one of the columns. 

The error will likely recur. 

Then sort on a different column.   

Repeat until there is no error. 

Sent from my iPhone

On Jul 17, 2020, at 6:59 AM, KoenP <koen....@gmail.com> wrote:


Jim,
your suggestion to replace with Name works fine, thanks. But how to correct definitely, I cannot go on each and every time to replace and working with the debugger.
Stay healthy,
Koen

Op vrijdag 17 juli 2020 05:57:45 UTC+2 schreef KoenP:
Hi,
I am facing an error in my GoFish5: Message:      SQL: ORDER BY clause is invalid.
Trust the attached file gives an enough information how to settle this.
Anyone with a solution for this?
Thanks,
Koen


--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.

Matt Slay

unread,
Jul 17, 2020, 11:46:50 AM7/17/20
to foxpro...@googlegroups.com

Mike - Indeed, this was recorded on June 21, 2018 as Issue # 5 on the GoFish Repository on GitHub, however, that code change has not been added to the main code base, nor has an updated release of GF been released with this change in it.

https://github.com/mattslay/GoFish/issues/5

Maybe one day I will get around to this, but it is not something I can spend any time on at the moment.

However, give that GF is an open source project, anyone out there could apply the fix and send a pull request, that might expedite things. It need not wait around on me, or Jim to make a fix. We'd love to see others in the community dive in and be involved in GF code base and release cycles.  It could help keep it alive in a more community-driven way.

KoenP

unread,
Jul 17, 2020, 11:48:13 AM7/17/20
to GoFish
Jim,
Come on. I do want to follow your suggestions. In fact I did. Unfortunately it did not work out for me. What is the  matter, did I insult you to request Mike for showing his solution? If so, I feel sorry.
Stay healthy,
Koen

Op vrijdag 17 juli 2020 17:42:25 UTC+2 schreef Jim:

Jim Nelson

unread,
Jul 17, 2020, 11:51:06 AM7/17/20
to foxpro...@googlegroups.com
Did you try this?

After you resume you need to sort on one of the columns. 

The error will likely recur. 

Then sort on a different column.   

Repeat until there is no error. 



To unsubscribe from this group and stop receiving emails from it, send an email to foxprogofish...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/foxprogofish/e12b56b6-5ba6-4d43-95b1-857edbc8a871o%40googlegroups.com.

KoenP

unread,
Jul 17, 2020, 11:56:00 AM7/17/20
to GoFish
Matt,
OK I found your correction code, it seems this was already reported by myself years ago, pitty we never realized what to do to get this new code in GoFish45.app.  Will now imm change my code and rebuilt everything.
After that will report back if it helped.
Thanks sofar,
Stay healthy
Koen

Op vrijdag 17 juli 2020 17:46:50 UTC+2 schreef Matt Slay:
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.

Mike Yearwood

unread,
Jul 17, 2020, 11:58:43 AM7/17/20
to foxpro...@googlegroups.com
Hi Matt

You're right, of course. Thanks for the reminder and 'permission'. I'll do it later today.

Mike

Jim Nelson

unread,
Jul 17, 2020, 12:01:37 PM7/17/20
to foxpro...@googlegroups.com
Matt --

I've been out of the business of fixing code in GF, Thor, PEMEditor, and so on,  for a few years.

However, I am still willing to try to post workarounds (which, in this case, were not sufficient).



Matt Slay

unread,
Jul 17, 2020, 12:08:12 PM7/17/20
to foxpro...@googlegroups.com

Okay, so here are the steps (for anyone who wants to help with GF code base in the future)

1. Fork the GoFish repo into your own GitHub account.

2. Clone the code base to your own machine.

3. Make the code the code changes.

4. Commit locally

5. Push to your remote repo.

6. Send a Pull Request to the main GF repo that you Forked in Step 1.

7. I will accept your Pull Request, and do (some) local testing.

8. If my testing passes, I will build and release a new update though the Thor release tunnel.


Of all these steps, step # 8 is the most mysterious process, and a little harder to introduce other people to. But, unless we do get more people into that final step, updating through Thor can't happen, although, users could still manually update directly from the Repo files.


- Matt Slay


KoenP

unread,
Jul 17, 2020, 12:40:37 PM7/17/20
to GoFish
Matt,
the by Mike promoted changement works fine, please add a space in the code:

SELECT &lcFields2 From (Select * From(m.lcSearchEngineResultsAlias) Order By &lcOrderBy) source ;
      Into Cursor gf_temp_csrReadWrite

gt_temp_csr and ReadWrite.

My Gofish5 works as it should be. Thanks Mike, Thanks Jim.

for the actions you give here below, you do have to clarify please

what is Fork ?
what do mean by Clone, is that the same as download and install
how do you push when you are not a member on Github? Ditto for a Pull request?

Can you confirm that since I have now a changed and working GoFish5 (Thank you) it will not be overwritten with the unchanged code now in GitHub?
Please, please, please change a.s.a.p. to prevent this.
Stay healthy,
Koen

Op vrijdag 17 juli 2020 18:08:12 UTC+2 schreef Matt Slay:
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.

Matt Slay

unread,
Jul 17, 2020, 12:45:41 PM7/17/20
to foxpro...@googlegroups.com
what is Fork ?
what do mean by Clone, is that the same as download and install
how do you push when you are not a member on Github? Ditto for a Pull request?

Koen - these are basic items of modern software source code management and open source development of software. You can find some intro videos on Youtube.

We should should not dive into this topic in this thread or in this forum. Please start a new thread outside of this forum to continue discussion on this matter.
To unsubscribe from this group and stop receiving emails from it, send an email to foxprogofish...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/foxprogofish/5ab14f6b-e10c-4833-9c65-4ae8d046ff6do%40googlegroups.com.

KoenP

unread,
Jul 18, 2020, 5:45:40 PM7/18/20
to GoFish
Matt,
we are talking about VFP here, GoFish is 100% VFP developped application, please do not mix simple things with other software topics.
There is no fork or forking in VFP.
Thanks for helping to solve the bug in GF, a magnificent application developed also by yourselves. Is it your intention to publish a new version of GF with the corrected code?
Stay healthy,
Koen. 

Mike Yearwood

unread,
Jul 18, 2020, 6:52:18 PM7/18/20
to foxpro...@googlegroups.com
Matt suggested I make the update and he will release it to the public. I said I would make the change later. Then he will release a version with this code. I'll be the first guinea pig.

To unsubscribe from this group and stop receiving emails from it, send an email to foxprogofish...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/foxprogofish/5ab14f6b-e10c-4833-9c65-4ae8d046ff6do%40googlegroups.com.

Matt Slay

unread,
Jul 18, 2020, 8:18:15 PM7/18/20
to foxpro...@googlegroups.com
I mean, I could make this code change directly, myself, and cut out all these steps, and I’m willing to do that. 

But, it would be great to see it unfold with some pull requests from the community. 

I’ll leave it up to Mike if he wants to go that route for the experience of it. If not, I’ll do it all myself. 



- Matt Slay


On Jul 18, 2020, at 5:52 PM, Mike Yearwood <mike.y...@gmail.com> wrote:



Mike Yearwood

unread,
Jul 18, 2020, 10:03:38 PM7/18/20
to foxpro...@googlegroups.com
Yes please. We can augment the instructions.

KoenP

unread,
Jul 19, 2020, 5:23:28 AM7/19/20
to GoFish
Matt,
I also read that this bug #5 in GoFish, are there more that these and would you mind to correct them all in your new release and not only #5?
Thanks,
Stay healthy,
Koen

Op zondag 19 juli 2020 02:18:15 UTC+2 schreef Matt Slay:

--
You received this message because you are subscribed to the Google Groups "GoFish" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foxpro...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages