Home Features Toolbar Library Forum Download Support Tutorial Manual
3. Reference
Triggers
Controls
Variables
System Variables
Global Values
Functions
AutoFill()
Back()
Beep()
CheckLinks()
Checksum()
Click()
Command()
Customize()
DeleteOption()
Enable()
Execute()
ExportLinks()
Forward()
GetFolderIcon()
GetQuery()
GetSystemIcon()
Header()
Highlight()
HistoryMenu()
Home()
IfExactMatch()
IfMatch()
ImportValue()
ImportCaption()
ImportIntValue()
ImportXMLValue()
Length()
LoadMenu()
Menu()
OpenURL()
Options()
PageText()
PlaySound()
PopupManager()
Refresh()
Replace()
ReplaceAll()
Resize()
ResizeClient()
Redraw()
Save()
Search()
SearchBack()
SearchLast()
SearchNext()
SearchPage()
SetCaption()
SetClipboard()
SetFocus()
SetFontSize()
SetIcon()
SetOption()
SetParam()
SetText()
SetStatusText()
SetTooltip()
SetUserAgent()
SetValue()
Show()
Stop()
StripHTML()
ToolbarMenu()
TruncateOption()
UpdateToolbar()
Zoom()
Text Functions
  

IfMatch() Function

Performs a string match and if true, performs a specified action.


Syntax:

    IfMatch(string,match,action)


Parameters:


    Parameter: Description:
    string string to match. Can include variables.
    match sub-string to match. Can include variables.
    action action to take if a positive match is made. This can include one or more functions separate by a semicolon.
    else alternate action to take if no match is made. This can include one or more functions separate by a semicolon.



Remarks:

  • The IfExactMatch() and IfMatch() functions are used to provide basic logic.
  • The string matching is not case sensitive.
  • The else parameter is optional and does not need to be specified.
  • The else parameter is ignored in Toolbar Browser versions prior to 2.3.1


Example:

    In the following example, the IfMatch() function is used to place a notice on the toolbar if a user visits a page on the trellian.com domain.


    <xml id="toolbar">
    <toolbar caption="IfMatch() Example">
    <control type="toolbar">
    <button
      caption="..."
      id="button1"
      action="http://www.trellian.com"
      onload="IfMatch($URL,'trellian.com',SetCaption(button1,'Latest Release!!!'); SetParam(button1, "action",'http://www.trellian.com/download.com'))">

    </button>
    </control>
    </toolbar>
    </xml>



    When ever a new page is loaded, the onload= event trigger executes the IfMatch() function. If the URL of the page matches the specified URL, in this case 'trellian.com', the button caption is changed. The second function SetParam() changes the button's default action.

    Note the use of the $URL system variable to compare the currently loaded page.



Compatibility:

    Requires ToolbarBrowser version 2.3.1 or later.
    In versions prior to 2.3.1, the else parameter is ignored.


Website Popularity Rank | Build Your Own Toolbar | Free Download | Custom Toolbars | Features | Contact Us

ToolbarBrowser is a freeware project supported by Trellian Limited. | Privacy Policy