Source language: Translate to:

Using the Find command to search a text box

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Using the Find command to search a text box

Postby Enigman » Sat Apr 13, 2013 11:16 am

I am trying to use the Find command to search the contents of a multiline text box. It works fine for the first occurance, but when I click Find Next, it never finds any additional occurances even though the string can be seen again soon after the first one.

So, since the Find command is aimed at pages rather than individual elements, will it not find another occurance of the string on the same page?

Is there any workaround to make it do this?

My app is only one page and one big text box so I need to be able to find all occurances of a string within the box.

Any help would be appreciated.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using the Find command to search a text box

Postby mishem » Sat Apr 13, 2013 12:19 pm

mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm

Re: Using the Find command to search a text box

Postby Enigman » Sat Apr 13, 2013 1:02 pm

Thanks, but I am looking for a FIND function, rather than a SEARCH function. I see no Find action in the hpwControls.

A Find function will locate and highlight instances of words on the page or text object, using "Find First" and "Find Next" buttons. It is a user interactive function.

As currently written in NeoBook 5.8.3, Find is "Page targeted" rather than being "Object targeted". I am looking for a way to make it object targeted.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using the Find command to search a text box

Postby HPW » Sat Apr 13, 2013 1:31 pm

You are asking for a SelectText Action for the Multiline-Text entry.
Since this does not exist, you may use a different text-object with support for that.
From my stuff this would be hpwColormemo or hpwPlusMemo.
Together with hpwStrSearch from hpwControl you could build that findbehaviour

Findfirst
Code: Select all
Setvar "[Offset1]" "1"
hpwStrSearch "[SearchString1]" "[ViewSource]" "[Offset1]" "[CaseSens1]" "[SearchResult]"
If "[SearchResult]" "<>" "0"
  StrLen "[SearchString1]" "[SearchLength1]"
  hpwColorMemoSelectPos "RColMemo1" "[SearchResult]-1" "[SearchLength1]"
Else
  AlertBox "Find String" "String not found!"
EndIf


Findnext
Code: Select all
SetVar "[Offset1]" "[SearchResult]+1"
hpwStrSearch "[SearchString1]" "[ViewSource]" "[Offset1]" "[CaseSens1]" "[SearchResult]"
If "[SearchResult]" "<>" "0"
  StrLen "[SearchString1]" "[SearchLength1]"
  hpwColorMemoSelectPos "RColMemo1" "[SearchResult]-1" "[SearchLength1]"
Else
  AlertBox "Find String" "String not found!"
EndIf
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Using the Find command to search a text box

Postby mishem » Sat Apr 13, 2013 2:03 pm

You can still try
Editor's Toolbox
mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm

Re: Using the Find command to search a text box

Postby Enigman » Sat Apr 13, 2013 3:18 pm

mishem wrote:You can still try
Editor's Toolbox

Thanks for the pointer, although for my app I cannot use a dedicated editor style text box. My app is a small utility that must use a standard multi-line text box. The app is a "text cleaning" utility. It is meant to receive text from the clipboard that has been copied from a word processor document or web page. The nature of the text box is that it either exposes or ignores any formatting codes incoming from the clipboard. The user can then use tool buttons to reflow the text and eliminate extra spaces and carriage returns, or perform many other capitalization and format corrections. The input is converted to plain text, manipulated with the tools, and then copied back out to use in a web page editing service. So it is "any text in", and "plain text out", with structural improvements along the way. Whatever I do to support a Find function must only do temporary highlighting and not add rich text or other formatting codes as a dedicated editor object might.

Thanks again.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using the Find command to search a text box

Postby Enigman » Sat Apr 13, 2013 3:19 pm

HPW wrote:You are asking for a SelectText Action for the Multiline-Text entry.
Since this does not exist, you may use a different text-object with support for that.
From my stuff this would be hpwColormemo or hpwPlusMemo.
Together with hpwStrSearch from hpwControl you could build that findbehaviour

Thanks, I'll try that and see what happens.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using the Find command to search a text box

Postby dpayer » Sun Apr 14, 2013 7:08 am

Enigman wrote:Thanks, but I am looking for a FIND function, rather than a SEARCH function. I see no Find action in the hpwControls.

A Find function will locate and highlight instances of words on the page or text object, using "Find First" and "Find Next" buttons. It is a user interactive function.

As currently written in NeoBook 5.8.3, Find is "Page targeted" rather than being "Object targeted". I am looking for a way to make it object targeted.


NB doesn't have such a function for text. You can work around this though. You could also view the text by inserting it in an HTML document and then do a STReplace of the string and replace the word/phrase you want to find with that word encapsulated with an HTML span tag. Example: (from http://www.htmlgoodies.com/tutorials/ht ... AN-Tag.htm)

Affecting the Text's Background Color, Use This Format:
<SPAN STYLE="background-color: #ffffcc">Here's What You Get</SPAN>


Create a string with your text surrounded by the html codes for a document. Then do a StrReplace of the word/phrase you want.
Code: Select all
<html>
<body>
This is my text. I want to make the phrase "this is a yellow background" show up with a yellow background.
</body>
</html>
-----------------------------------------------
<html>
<body>
This is my text. I want to make the phrase <SPAN STYLE="background-color: #ffffcc"> "this is a yellow background" </span> show up with a yellow background.
</body>
</html>

If you are creative, you could add a link to the text in HTML to make NB act on it as you wish and then close the webbrowser object used to view it.
David P
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Using the Find command to search a text box

Postby mishem » Sun Apr 14, 2013 7:41 am

Enigman wrote:
mishem wrote:You can still try
Editor's Toolbox

My app is a small utility that must use a standard multi-line text box. Thanks again.

If I knew of course transfer, then when the editor is the ability to specify a variable to not rich text.
This is a very good plugin for working with text.
Image
mishem
 
Posts: 574
Joined: Mon Oct 08, 2012 1:51 pm

I use...Using the Find command to search a text box

Postby virger » Mon Apr 15, 2013 10:27 am

NBW Publication Source File
(C)1993-2011 NeoSoft Corp.
Title=Search And Replace
Author=GdoSan/ Jul/2011
Language=US
NeoBookVer=5.70
ScreenColors=16777216
ScreenWidth=640
ScreenHeight=480
BkndColor=0
ScreenAutoSize=Yes
LinkColor=16711680
WindowStyle=0
WindowOrder=0
WindowPos=0
WindowProps=31
BiDiMode=0
UseUpdateTimer=Yes
ReturnTime=60
ShapeTransColor=536870912
CompileType=0
MediaType=0
FilesIncluded=1
FontsIncluded=2
CopyExternalFiles=No
SetupMedia=3
SetupInstDir=C:\MyProgram
SetupTitle=Setup
SetupColors=16711680|0|65535
VersionMajor=1
VersionMinor=0
VersionRelease=0
VersionBuild=0
ReqExLevel=1
CustomFontName=Arial
CustomFontSize=9
CustomFontStyle=0
CustomCharset=1
CacheSize=30
ExtractOp=132
L_OK=OK
L_CANCEL=Cancel
L_YES=Yes
L_NO=No
L_CLOSE=Close
L_ERRORTITLE=Error
L_FINDTITLE=Find
L_FINDPROMPT=Find &What
L_FINDFIRST=&Find First
L_FINDNEXT=Find &Next
L_FINDERROR=Search text not found.
L_PWORDTITLE=Password required
L_PWORDMSG=Before continuing, you must first|enter the correct password.
L_PWORDPROMPT=&Password:
L_PWORDERROR=That's not the right password!
L_MEDIAERROR=In order to play this type of file you must install|the appropriate multimedia hardware and/or|software.
L_INTERNETERROR=Unable to locate Internet Browser software.
L_ABORTFUNCTION=Do you want to cancel this function?
L_EXTRACTERROR=This file could not be extracted and cannot be played.
L_INSTDIRPROMPT=Please enter the drive and directory where you would like this program to be installed. To accept the default drive and directory, simply press Enter.
L_INSTFOLDERPROMPT=Do you wish to create a program folder?
L_INSTRUNPROMPT=Do you want to run
L_INSTDISKPROMPT=Please insert disk #
L_INSTDISKERROR=That's not the correct disk, try again.
L_INSTGENERROR=The installation has terminated.
L_INSTEXITPROMPT=Do you really want to cancel the installation?
L_INSTWINTITLE=Setup
L_INSTPROGTITLE=Extracting Files...
L_SENDEMAIL=Sending Mail...
L_MAILSERVER=Please enter the name of your outgoing email server:
L_COPY=Copy to Clipboard
L_SELECTALL=Select All
L_DONWLOADFILE=Downloading: %s
L_PLEASEWAIT=Please wait...
TrayMenuBegin
MenuName=TrayOpen
MenuText=Open
MenuState=3
MenuKey=0
MenuAction=SetVar "[WindowState]" "Normal"
MenuName=TrayExit
MenuText=Exit
MenuState=3
MenuKey=0
MenuAction=Exit "" ""
MenuEnd
MasterPage
NewPage=New Page
PageStyle=0
PageColor=16777215
PageGradient1=16711680
PageGradient2=255
PageGradientDir=1
WallpaperStyle=0
ObjectType=14
Name=Web
X=0
Y=195
W=320
H=285
Anchor=0
VarName=[WebStatus]
TitleVarName=[WebTitle]
URLVarName=[WebAddr]
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=16
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=3
Name=BtExe
X=497
Y=66
W=136
H=50
Anchor=0
Text=Do It...
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=setvar "[colort]" "Red"¶setvar "[colorb]" "White"¶Call "MiReplace" "[busca]" "[texto]" "[colort]" "[colorb]" "[Ret]"¶¶BrowserLoadFromStr "Web" "<html><body><div>|[ret]|</div></body></html>"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Enabled=No
TabOrder=3
ObjectType=9
Name=BusEnt
X=452
Y=32
W=182
H=30
Anchor=0
VarName=[busca]
EditLen=0
ObjAction=if "[busca]" "=" ""¶ DisableObject "BtExe"¶else¶ EnableObject "BtExe"¶endif
LineColor=0
LineWidth=1
LineStyle=0
FillColor=13693176
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=4
ObjectType=9
Name=TxEnt
X=6
Y=31
W=433
H=118
Anchor=0
VarName=[texto]
EditMultiLine=Yes
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=15268080
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=5
ObjectType=8
Name=Inf0
X=7
Y=9
W=250
H=22
Anchor=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red0\green0\blue0;}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}¶{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶\endnhere\sectdefaultcl{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 Text To Search/Change}}¶}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=15268080
FillPattern=1
TabOrder=9
ObjectType=8
Name=Inf1
X=500
Y=8
W=132
H=22
Anchor=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red0\green0\blue0;}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}¶{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶\endnhere\sectdefaultcl{\pard{\qr\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 Word To Change}}¶}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=15268080
FillPattern=1
TabOrder=7
ObjectType=9
Name=TexRet
X=321
Y=195
W=320
H=284
Anchor=0
VarName=[ret]
EditMultiLine=Yes
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12634360
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=6
ObjectType=8
Name=Inf2
X=151
Y=170
W=340
H=22
Anchor=0
Font=Arial
FontSize=12
FontStyle=3
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red0\green0\blue0;}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}¶{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶\endnhere\sectdefaultcl{\pard{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0\b\i HTML --- FORMAT --- TEXT}}¶}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=15268080
FillPattern=1
TabOrder=8
ObjectType=8
Name=TheFunction
X=68
Y=40
W=520
H=406
Anchor=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 THE FUNCTION: MiReplace\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 ------------------------\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \{NeoBook Function\}\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Version=5.70\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Language=JScript\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Param=[%rg]|Variable|Search\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Param=[%tx]|Variable|Text\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Param=[%kt]|Variable|Text Color\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Param=[%kb]|Variable|BackGround Color\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 Param=[%rt]|Variable|Text To Return\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \{End\}\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 var rg = nbGetVar("[%rg]");\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 var tx = nbGetVar("[%tx]");\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 var kt = nbGetVar("[%kt]");\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 var kb = nbGetVar("[%kb]");\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \tab re = new RegExp(rg, 'gi');\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 if (kt)\{\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 // OJO:\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \tab TgIni = "<font style='color:"+kt+"; background-color:"+kb+"; \plain\f0\fs20\cf0 size=14; '>";\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \} else \{\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 TgIni = "<font style='font-size:18px; font-weight:bold; \plain\f0\fs20\cf0 font-style:italic; color:#000; background-color:#FF0;'>";\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \}\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \tab TgFin = "</font>";\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 rt = tx.replace(re, TgIni + rg + TgFin ) ;\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 nbSetVar( '[%rt]',rt )\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 )\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 }}¶}
HMargin=0
VMargin=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16382457
FillPattern=0
TabOrder=10
---------------

Pura Vida
From Costa Rica
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 510
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Using the Find command to search a text box

Postby Enigman » Mon Apr 15, 2013 11:17 am

Thanks, but I mentioned earlier that due to the app intent, I cannot do this in anything but the multiline text box. It does me no good to show highlights in a browser or an editor object. I have to highlight the target text directly in the multiline text box and no where else.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using the Find command to search a text box

Postby dpayer » Mon Apr 15, 2013 1:17 pm

Enigman wrote:Thanks, but I mentioned earlier that due to the app intent, I cannot do this in anything but the multiline text box. It does me no good to show highlights in a browser or an editor object. I have to highlight the target text directly in the multiline text box and no where else.

Thanks.



It works for me. Here is a demo. Copy the code and paste it into a new publication (800x600). It has some text in a multiline text box and you can search for the word 'and' and it will find all the instances.

David P

Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5.80
ObjectType=9
Name=TextEntry1
X=67
Y=36
W=668
H=290
Anchor=0
Text=This Refcard is written to ease development and operations teams'¶transition from traditional release cycles to Continuous Delivery by giving¶guidance, advice, and best practices. Also included is a comprehensive¶checklist to ensure that your transition will proceed smoothly.¶¶This Refcard includes best practices, tools, and checklists covering:¶¶ * Objectives¶ * Prerequisites¶ * Release automation¶ * Implementing a deployment pipeline... and more!¶
VarName=[TextEntry1]
Align=1
EditMultiLine=Yes
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=3
Name=PushButton1
X=557
Y=372
W=174
H=46
Anchor=0
Text=Find
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=Find "New Page"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=3
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Using the Find command to search a text box

Postby Enigman » Mon Apr 15, 2013 2:01 pm

It works for me. Here is a demo. Copy the code and paste it into a new publication (800x600). It has some text in a multiline text box and you can search for the word 'and' and it will find all the instances.

No luck. When I save the code and try to open it, NeoBook says it is not a valid publication. Something must be missing.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Using the Find command to search a text box

Postby dpayer » Mon Apr 15, 2013 2:50 pm

Enigman wrote:
It works for me. Here is a demo. Copy the code and paste it into a new publication (800x600). It has some text in a multiline text box and you can search for the word 'and' and it will find all the instances.

No luck. When I save the code and try to open it, NeoBook says it is not a valid publication. Something must be missing.


Sorry, this is NOT a pub doc. It is a doc I made which I then did a select all and copied it into the code section of the forum. Do not save it as a .pub file and try to open it. Create a new empty pub (800x600), copy this code and PASTE it into the doc and then run it. It will work.

David
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Using the Find command to search a text box

Postby Enigman » Mon Apr 15, 2013 7:10 pm

dpayer wrote:It works for me. Here is a demo. Copy the code and paste it into a new publication (800x600). It has some text in a multiline text box and you can search for the word 'and' and it will find all the instances.

Okay ... I THOUGHT "Find" was supposed to locate all occurances in the text box, and I thought I remembered it doing that. But it hasn't done it for me in this application for a looooong time. For whatever reason, something is blocking the Find command from working in my app. It finds the first of a given string, then when you click Find Next it says the string is not found even though you can see more than one of the string in the box lower down.

So I'd like to invoke NeoBook Support here ... Dave? ... you there?

What could cause this behavior? Anyone?
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest

cron