Author Topic: search box's [RESOLVED]  (Read 18449 times)

tools-n-stuff

  • Newbie
  • *
  • Posts: 38
Re: search box's
« Reply #15 on: October 25, 2010, 06:50:14 PM »
Oh man, i am at the point of giving up, 3 days wasted on a damn dropdown menu. I bet your having a good old laugh at my expense.

No i hadn't declared endline as a variable and now that i have it shows the list but wont send back the search results.
Once again i have looked everywhere to try and find the solution.

I don't suppose you have a working example i can use, because getting bits of info every now and again is doing my head in and its not helping me learn or understand what i am doing.

Thanks again for being patient!
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 461
  • Here to help you
Re: search box's
« Reply #16 on: October 25, 2010, 07:57:22 PM »
Quote from: "tools-n-stuff"
Oh man, i am at the point of giving up, 3 days wasted on a damn dropdown menu. I bet your having a good old laugh at my expense.

No, seriously its no laughing matter - I'm programming seven days a week and most days I do something damn silly or miss the obvious - but thats the nature of programming. Look in any programming forum and you'll see the same - everything is easy with hindsight.

Anyhow, you know you have made a lot of progress and have spotted how certain types of bugs can occur - spelling mistakes, variables not declared etc, side effects you didn't know about ......



Quote from: "tools-n-stuff"
I don't suppose you have a working example i can use, because getting bits of info every now and again is doing my head in and its not helping me learn or understand what i am doing.

Thanks again for being patient!

The Search routine just takes some values and then places some results in a field - you could put some debug messages inside the Search routine and see where things go wrong - then you will have cracked it.
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

tools-n-stuff

  • Newbie
  • *
  • Posts: 38
Re: search box's
« Reply #17 on: October 25, 2010, 09:41:29 PM »
Now i don't understand whats going on.
Where-as i said before the plist is place, but not sending the search results back. Well it is now. All i have done is switch my PC off and come back a couple of hours later and the damn thing is working. I don't get it!

Ok its not working entirely as it only sends results back from the first plist item, but i guess i will eventually find it (probably with your help).

As for adding a debug message, well you got me again.

In the 3d markup language i use i only have to add <debug> at the top of the page and it does the job when trying to run the 3D environment. If there is a bug somewhere then it will show, what and where.

I tried this in HN but that returned as a bug  :D

Anyway, im off to see if i can find out why the plist only works for the first item
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

tools-n-stuff

  • Newbie
  • *
  • Posts: 38
Re: search box's
« Reply #18 on: October 26, 2010, 01:29:03 PM »
I spent most of last night and this morning going over the guides (built in and online) and can't work out why it only works on the 1st plist item.

Now knowing you program 7 days a week, i imagine asking you to look over my project is out of the question?
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 461
  • Here to help you
Re: search box's
« Reply #19 on: October 26, 2010, 01:37:30 PM »
Quote from: "tools-n-stuff"
I spent most of last night and this morning going over the guides (built in and online) and can't work out why it only works on the 1st plist item.

Now knowing you program 7 days a week, i imagine asking you to look over my project is out of the question?

Its fine - its just that often I can't answer forum questions quickly.

If you can post the code for the Search routine and the outputs then we might be able to find the problem - and so help other forum readers as well :)
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

tools-n-stuff

  • Newbie
  • *
  • Posts: 38
Re: search box's
« Reply #20 on: October 26, 2010, 02:04:01 PM »
MODIFIED - names only

Thats great thanks, and i can understand your lack of time, i wasn't having a go at you  :oops:

Just a thought, maybe this whole thread could be moved to 'Interface Controls'

This is from the searchfields in the main code:

Quote
@ --- Get list to search ---
If fnum=1 Then
   If fnum=1 Then
    Put titleVar into searchlist
EndIf
If fnum=2 Then
    Put authorVar into searchlist
EndIf
If fnum=3 Then
    Put publisherVar into searchlist
EndIf
If fnum=4 Then
    Put commentVar into searchlist
EndIf
If fnum=17 Then
    Put dateVar into searchlist
EndIf
If fnum=18 Then
    Put languageVar into searchlist
EndIf
If fnum=19 Then
    Put salesVar into searchlist
EndIf
If fnum=20 Then
    Put otherVar into searchlist
EndIf

Put LinesFN(titleVar) into nbooks

Clear searchResults

For n=1 to nbooks
      Put line n of searchlist into buff
      Put FindWordFN(buff,sword) into wpos
      If wpos>0 Then
         Put n after searchResults
      EndIf      
EndFor

Put searchResults into field 5

And this is from the card:
Quote
Local plist

Put 'Title' into plist
Put 'author' after plist
Put 'Publisher' after plist
Put 'Comment' after plist
Put 'Date' after plist
Put 'Language' after plist
Put 'Sales' after plist
Put 'Other' after plist

@ set line endings for Windows platform
Local endline
Put EndLineFN(3) into endline
Put ReplaceEndsFN(plist,endline) into plist

PopupSetText(1,plist)
PopupSetIndex(1,1)

Global searchResults

Put searchResults into field 5

Call DisplayRecord

and finaly this is the button script:
Quote
Global searchIndex
Local sword

Clear field 5

Put field 21 into sword
Call SearchFields(searchIndex,sword)

I think thats all is needed, but please correct me if i am wrong.
I guess from the plist you can guess what i am trying to achieve!

MODIFIED - names only
« Last Edit: October 26, 2010, 07:24:46 PM by tools-n-stuff »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 461
  • Here to help you
Re: search box's
« Reply #21 on: October 26, 2010, 05:13:05 PM »
Thank you for all the details it makes things a lot clearer.

Just wondering - in the script for the PopupMenu do you have this or something similar assuming that the PopupMenu is number 1?

Code: [Select]
Global searchIndex

Put PopupIndexFN(1) into searchIndex
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

tools-n-stuff

  • Newbie
  • *
  • Posts: 38
Re: search box's
« Reply #22 on: October 26, 2010, 06:58:08 PM »
OOPs! I forgot to mention that one, i have as follows:

Code: [Select]
Global searchIndex

@ Which field to search

Put PopupIndexFN(1) into searchIndex
Put PopupTextFN(1) into searchIndex
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 461
  • Here to help you
Re: search box's
« Reply #23 on: October 26, 2010, 07:23:34 PM »
Quote from: "tools-n-stuff"
OOPs! I forgot to mention that one, i have as follows:

Code: [Select]
Global searchIndex

@ Which field to search

Put PopupIndexFN(1) into searchIndex
Put PopupTextFN(1) into searchIndex

ah - we might have found it - the second Put statement overwrites the value of searchIndex so you only need

Code: [Select]
Global searchIndex

@ Which field to search

Put PopupIndexFN(1) into searchIndex

I originally put that second Put statement in as a way of placing the Popuomenu's text into a field for debugging purposes.
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

tools-n-stuff

  • Newbie
  • *
  • Posts: 38
Re: search box's
« Reply #24 on: October 26, 2010, 07:48:54 PM »
Excellent its working, except a couple of fields not returning the search results, but i really think that's all down to me. Last week i came across HyperNext and i know nothing about building applications, I have shaken my brain every day since and i think i have lost my self in the info and naming  :oops:  This one i have to work out formyself  :lol:
I can't say how much i appreciate your help, and not to forget the fact that HyperNext is even there.

I feel like a big kid with a new toy.
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 461
  • Here to help you
Re: search box's
« Reply #25 on: October 26, 2010, 08:43:40 PM »
Thats really great progress you've made - all in just a week - perseverance - i just hope you remember to have rest sometimes. :)
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

tools-n-stuff

  • Newbie
  • *
  • Posts: 38
Re: search box's [RESOLVED]
« Reply #26 on: October 27, 2010, 12:48:01 AM »
Ok! as mentioned in my last post, i thought it was down to me. Yup! Sure was. Because of my confusion amongst the field names and texts names and the fact that i just started to build on top of the original Book HN without giving it any thought. I found myself adding components, changing my mind, removing them and the code was a real mess. So i decided to clean it up so that a text name corresponds with its field name, obviously doing the necessary to make sure i kept track of what code came from what button etc so as to build everything tidily and replace the code. I thought it would make it easier to find the problem with everything in order!
And then i broke it, i broke the whole damn thing. What a nightmare! Since the precise time marked on my last post and the time on this one that is the time iv'e spent trying to figure it out.
Thankfully though and after a few hours i managed to sort it all out. Yes, talk about happy!
Along the way i found that i hadn't declared a couple of variables and one even had its space 'comma' between the name and the Var ('name,Var' and not 'nameVar,' ) This led me onto see the difference between the field and the field name and discover other problems for the search and saving etc.
And that maybe, certain components can be outligned black if there is a conflict or something. Not sure on that one though.
There remains just two problems and that is:
1)  i can't see how to make the search return multiple finds. But thats possibly because i haven't looked yet i was just happy with a fully functional drop down search system.
2) i also have a ghost button that just wont go away. It has been deleted, but remains in the card script.
Even with those two small issues, i actually started to see the logic. Sure i have a whole load of questions for you, and i know im gonna do your head in head. But i will save them for another thread and another day.
I have other issues to look at now like maths, what seems to be the built in registration system, password login if possible, saving the imported image to the data/arrays and displaying the saved info into a second page. Clone a card would be handy.

Its 1.45 am and i am going to have a quick 'celebratory' beer, before turning in. Tomorrows going to be a busy day  8-)
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 461
  • Here to help you
Re: search box's [RESOLVED]
« Reply #27 on: October 27, 2010, 09:40:51 AM »
Quote from: "tools-n-stuff"
Ok! as mentioned in my last post, i thought it was down to me. Yup! Sure was. Because of my confusion amongst the field names and texts names and the fact that i just started to build on top of the original Book HN without giving it any thought. I found myself adding components, changing my mind, removing them and the code was a real mess. So i decided to clean it up so that a text name corresponds with its field name, obviously doing the necessary to make sure i kept track of what code came from what button etc so as to build everything tidily and replace the code. I thought it would make it easier to find the problem with everything in order!
And then i broke it, i broke the whole damn thing. What a nightmare! Since the precise time marked on my last post and the time on this one that is the time iv'e spent trying to figure it out.
Thankfully though and after a few hours i managed to sort it all out. Yes, talk about happy!
Along the way i found that i hadn't declared a couple of variables and one even had its space 'comma' between the name and the Var ('name,Var' and not 'nameVar,' ) This led me onto see the difference between the field and the field name and discover other problems for the search and saving etc.
And that maybe, certain components can be outligned black if there is a conflict or something. Not sure on that one though.
There remains just two problems and that is:
1)  i can't see how to make the search return multiple finds. But thats possibly because i haven't looked yet i was just happy with a fully functional drop down search system.
2) i also have a ghost button that just wont go away. It has been deleted, but remains in the card script.
Even with those two small issues, i actually started to see the logic. Sure i have a whole load of questions for you, and i know im gonna do your head in head. But i will save them for another thread and another day.
I have other issues to look at now like maths, what seems to be the built in registration system, password login if possible, saving the imported image to the data/arrays and displaying the saved info into a second page. Clone a card would be handy.

Its 1.45 am and i am going to have a quick 'celebratory' beer, before turning in. Tomorrows going to be a busy day  8-)

Job well done - congratulations - now we can start a new thread :)

About the ghost button - thanks for reporting it - I thought that bug was fixed a long time but clearly not.
I wonder if the button is still on the card - but has gone out of bounds. On the Properties toolbar is a small button "IV" - its for fetching out of bound controls back into view.
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

tools-n-stuff

  • Newbie
  • *
  • Posts: 38
Re: search box's [RESOLVED]
« Reply #28 on: October 27, 2010, 10:38:37 AM »
No, its not a bug you must have fixed it.
I hadn't even noticed that 'IV' button. Nice option.
« Last Edit: January 01, 1970, 01:00:00 AM by Guest »