Author Topic: Word Search  (Read 1855 times)

0 Members and 1 Guest are viewing this topic.

Offline George McGinn

  • Global Moderator
  • Forum Regular
  • Posts: 210
    • Resume
Word Search
« on: October 13, 2021, 11:37:20 am »
A couple of days ago I went through Fellippe's video and recreated his program, so I have zipped it up and is available.

However, I have made some improvements to it, namely:
  • Added a QUIT button, as I found out on MAC OSX, there is no X button to close the form, and the red dot is greyed out.
  • Formatted the search results using @SMcNeill' format string function he wrote and updated for me (https://www.qb64.org/forum/index.php?topic=4031.msg133716#msg133716)
  • Removed all the code not needed (You need to leave all the generated SUBs in, but can remove statements not used)
The zip file contains:
  • bible.txt - The text version of the King James Bible from the Gutenberg Project
  • countWords.bas - The original console version from the video
  • wordSearch.bas - The source code originally generated by InForm, with the updates from countWords and my additional changes
  • bibleSearch.bas - Shows what the code would/should look like after removing all the SELECT/CASE statements not needed
  • wordSearch.frm - The form file generated by InForm
  • wordSearch - A Linux Binary file, which after compiling, is the only file needed for distribution (unless you need to supply Font files)
  • InForm - A folder with all the files necessary to compile the programs in QB64 or edit the form in InForm
You will also notice that there is no form named bibleSearch.frm. That's because I use the wordSearch.frm in that program. Bear in mind that if you edit wordSearch.frm in InForm, it will create a new wordSearch form and BASIC program, or if the BASIC program already exists, will update your version without wiping out the code you placed in it.

Below is a screen print of my modified form while processing a search. When the search completes, the message changes to say "Search completed ...".
 
wordSearch4.png


Here is the Zip file:
 
 
____________________________________________________________________
George McGinn
Theoretical/Applied Computer Scientist
Member: IEEE, IEEE Computer Society
Technical Council on Software Engineering
IEEE Standards Association
American Association for the Advancement of Science (AAAS)

FellippeHeitor

  • Guest
Re: Word Search
« Reply #1 on: October 13, 2021, 10:43:54 pm »
Thanks for sharing it, @George McGinn! I'm really glad you got your feet wet with InForm. Keep 'em coming!