[jawsscripts] Re: Making a string title case

Martin,

Thanks for that, I couldn't see the problem but it now works as it should.

best regards

Mike

--------------------------------------------------
From: "Martin Slack" <m.g.slack@xxxxxxxxxxxx>
Sent: Wednesday, February 10, 2010 10:12 AM
To: <jawsscripts@xxxxxxxxxxxxx>
Subject: [jawsscripts] Re: Making a string title case

> Hi Mike,
>
>  Try renaming your StringCountSegment function to StringSegmentCount.
>
>  hth
>
> Martin
>
>
> ----- Original Message ----- 
> From: "Mike" <mike_sharp@xxxxxxxxxxxxx>
> To: <jawsscripts@xxxxxxxxxxxxx>
> Sent: Wednesday, February 10, 2010 7:03 AM
> Subject: [jawsscripts] Making a string title case
>
>
>> Hi all,
>>
>> I have been using the homer scripts but one function I need to use is
>> causing me trouble, it is the StringProperWords.
>> This function is meant to convert a string of text so that the first
>> letter
>> of every word is capitalized and lower case for the rest, however, when I
>> use the function the returned string is always blank.
>> I am not sure if this is something that I am doing wrong or if there is
>> something wrong in the script so I have pasted it below, I would use it
>> like
>> this:
>>
>> Let sText = StringProperWords (sText)
>>
>> Here is the script:
>>
>> String Function StringProperWords(String sText)
>> ;Capitalize the first letter of each word and lower case the rest
>> Var
>> Int iWord, Int iWordCount, Int iLength,
>> String sWord, String sReturn
>>
>> Let iWordCount = StringCountSegment(sText, " ")
>> Let iWord = 1
>> While iWord <= iWordCount
>> Let sWord = StringSegment(sText, " ", iWord)
>> Let iLength = StringLength(sWord)
>> Let sWord = StringUpper(StringLeft(sWord, 1)) +
>> StringLower(Substring(sWord,
>> 2, iLength - 1))
>> If iWord == iWordCount Then
>> Let sReturn = sReturn + sWord
>> Else
>> Let sReturn = sReturn + sWord + " "
>> EndIf
>> Let iWord = iWord + 1
>> EndWhile
>> Return sReturn
>> EndFunction
>>
>> Can anyone see anything obvious with this? Or, is anyone able to try the
>> script themselves and reply with results?
>> If there are any other methods to achieve what I need I would be happy to
>> listen to suggestions.
>>
>> Many thanks,
>> Mike
>> --------------------------------------------------
>> From: "Holdsworth, Lynn" <Lynn.Holdsworth@xxxxxxxxxxx>
>> Sent: Thursday, February 04, 2010 9:23 AM
>> To: <jawsscripts@xxxxxxxxxxxxx>
>> Subject: [jawsscripts] Re: GetTagIndex function
>>
>>> Cheers David. To be honest I'm still not sure what it does. Do you know?
>>> I'm guessing it returns the 1-based index of the first tag that matches
>>> the string you send it.
>>>
>>> Thanks, Lynn
>>>
>>> -----Original Message-----
>>> From: jawsscripts-bounce@xxxxxxxxxxxxx
>>> [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of David Farough
>>> Sent: 02 February 2010 18:21
>>> To: jawsscripts@xxxxxxxxxxxxx
>>> Subject: [jawsscripts] Re: GetTagIndex function
>>>
>>> here is an example which uses the GetTagIndex function.  I found this
>>> example in virtual.jss.
>>> Also you should check out MoveToTagByIndex and GetListOfTags functions.
>>>
>>> HTH
>>>
>>> void function SelectATagHelper(string sTag, string sAttrList,string
>>> sTitle)
>>> var
>>> string strBuf,
>>> string uCaseTag,
>>> string lCaseAttrs,
>>> int index,
>>> int nCurrent
>>> if InHJDialog () then
>>> SayFormattedMessage (OT_ERROR, cmsg337_L, cmsg337_S)
>>> return
>>> EndIf
>>> if !IsVirtualPCCursor() then
>>> SayQuickKeynavigationNotAvailable()
>>> return; feature not available in non-vpc mode endIf let
>>> uCaseTag=StringUpper(sTag) let lCaseAttrs=stringLower(sAttrList) let
>>> strBuf=GetListOfTags(uCaseTag,lCaseAttrs,LIST_ITEM_SEPARATOR)
>>> if !strBuf then
>>> SayFormattedMessage(OT_ERROR,formatString(CMSGNoTagsFound_L,ReturnTagTypeLiteral
>>> (sTag)),formatString(CMSGNoTagsFound_S,ReturnTagTypeLiteral  (sTag)))
>>> return; no tags found
>>> endIf
>>> let nCurrent=GetTagIndex(uCaseTag)
>>> let index = DlgSelectItemInList (strBuf, sTitle, false,nCurrent) if 
>>> index
>>> == 0 then
>>> return; user cancelled operation
>>> endIf
>>> if MoveToTagByIndex(index,uCaseTag) then
>>> sayLine()
>>> endIf
>>> endFunction
>>>
>>> David Farough
>>> Application Accessibility Coordinator/coordonateur de l'accessibilité
>>> Information Technology Services Directorate / Direction des services
>>> d'information technologiques Public Service Commission / Commission de 
>>> la
>>> fonction publique Email / Courriel:  David.Farough@xxxxxxxxxxxxx
>>> Tel. / Tél:    (613) 992-2779
>>>
>>>>>> "Holdsworth, Lynn" <Lynn.Holdsworth@xxxxxxxxxxx> 06:43 am Tuesday,
>>> February 02, 2010 >>>
>>> Hi,
>>>
>>> Do any of you know how the GetTagIndex function works? If so I'd really
>>> appreciate an example.
>>>
>>> Thanks in advance, Lynn
>>>
>>>
>>> --
>>> DISCLAIMER:
>>>
>>> NOTICE: The information contained in this email and any attachments is
>>>
>>> confidential and may be privileged.  If you are not the intended
>>> recipient
>>> you should not use, disclose, distribute or copy any of the content of 
>>> it
>>> or of any attachment; you are requested to notify the sender immediately
>>> of your receipt of the email and then to delete it and any attachments
>>> from your system.
>>>
>>> RNIB endeavours to ensure that emails and any attachments generated by
>>> its
>>> staff are free from viruses or other contaminants.  However, it cannot
>>> accept any responsibility for any  such which are transmitted.
>>> We therefore recommend you scan all attachments.
>>>
>>> Please note that the statements and views expressed in this email and 
>>> any
>>> attachments are those of the author and do not necessarily represent
>>> those
>>> of RNIB.
>>>
>>> RNIB Registered Charity Number: 226227
>>>
>>> Website: http://www.rnib.org.uk
>>>
>>>
>>>
>>> This message has been scanned for viruses by Websense Hosted Security -
>>>
>>> http://www.websense.com/content/HostedEmailSecurity.aspx
>>>
>>> __________á
>>> Visit and contribute to The JAWS Script Repository 
>>> http://jawsscripts.com
>>>
>>> View the list's information and change your settings at
>>> http://www.freelists.org/list/jawsscripts
>>>
>>> __________
>>> Visit and contribute to The JAWS Script Repository 
>>> http://jawsscripts.com
>>>
>>> View the list's information and change your settings at
>>> http://www.freelists.org/list/jawsscripts
>>>
>>>
>>>
>>> To report this e-mail as Spam, please forward it to:
>>> spam@xxxxxxxxxxxxxxx
>>> __________
>>> Visit and contribute to The JAWS Script Repository 
>>> http://jawsscripts.com
>>>
>>> View the list's information and change your settings at
>>> http://www.freelists.org/list/jawsscripts
>>>
>>>
>> __________
>> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>>
>> View the list's information and change your settings at
>> http://www.freelists.org/list/jawsscripts
>>
>
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
>
> 
__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: