[jawsscripts] Re: Help requested for a string list in while loop.

  • From: Bob <temp@xxxxxxxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Tue, 19 Feb 2019 08:31:57 +0000

while iLoop < L1 means that the loop won’t run for the last segment. 

Try while iLoop < L1 + 1 or
While iLoop <= L1

Bob

On 19 Feb 2019, at 08:12, jitender kumar@5142695 <Jeet.Kumar1@xxxxxxxxx> 
wrote:

Hello friends, there is a problem, if a string list is run through while 
loop, and the desired string is at the end of the list, function works fine, 
else it does not.
Const
Domains_list="and|ahm|ban|bho|bhu|cha|che|del|guw|hyd|jai|ker|kol|luc|mum|pat|abs|corp|fo"
Int Function IsClassicModeActive ()
Var
Object Buttons1, Object Bar, Object attribs_list, String SValue,
Int ILoop, Int IReturn, Int L1
Let Iloop = 1
L1 = StringSegmentCount (domains_List, "|")
   while iLoop < L1
SValue = StringSegment (Domains_List, "|", ILoop)
;SayString (SValue)
SValue = StringLower (SValue)
If StringContains (SValue, "del") then
SayString (Svalue)
;the string is read, but since loop is not broken on finding the string, the 
function does not return 1.
IReturn = 1

Else
IReturn = 0
;SayInteger (Ireturn )
EndIf
ILoop = ILoop +1
EndWhile
;SayInteger (IReturn )
Return IReturn
EndFunction


The information in this mail is confidential and is intended solely for 
addressee. Access to this mail by anyone else is unauthorized. Copying or 
further distribution beyond the original recipient may be unlawful. Any 
opinion expressed in this mail is that of sender and does not necessarily 
reflect that of State Bank group.
---

__________�

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


__________�

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

Other related posts: