how to select the random list from lslist table. it is string values
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to select the random list from lslist table. it is string values
if Trim(UCASE(curobj.Exists))= "TRUE" then
Set recgText = OCR.Recognize.curobj
If recgText.BlockCount > 0 Then
Log.AppendFolder("Recognized text by blocks")
For i = 0 To int(recgText.FullText)
Randomize
Log.Message(recg.Block(i).Click)
Next
Log.PopLogFolder
End If
End Function
It gives me cannot convert string value. i want to select a random value from the listtable.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Full text has a method
Blockbytext and checktext
Tried the below code
min =1
max =aqstring.Getlength(curobject.fulltext)
randomize
rand=Int(max-min+1)*Rnd+min)
log.message(curobject.block(rand).blockbytext)
did not work as fulltext will need a string
also tried converting that to string still no luck.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This is something that you must investigate yourself using Object Browser and talking to your developers. Just because we know nothing about your tested application.
> Full text has a method [...]
> fulltext will need a string [...]
From what I can see on the previously provided screenshot:
-- FullText is a property, thus it does not have any methods;
-- FullText is a property and seems already be of string type;
Assuming that
max =aqstring.Getlength(curobject.fulltext)
line of code returns correct number of lines,
does this line returns correct line of FullText property
log.message(aqString.GetListItem(curobject.FullText, rand) ?
If it does, then the only thing you should do if to figure-out how to click correct line in the list (or navigate to it using keyboard by pressing Down Arrow key and confirming selection by pressing Enter key).
Alternative approach that often works for custom or not supported controls is to talk to developers and ask if the required action (selection of list item in your case) can be done using native methods available from the Methods tab in the Object Browser.
/Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Alex. I will check with the developer. i did previously tried the option aqString.GetListItem(curobject.FullText, rand) it gave me the one or more aruguments out of range. so ldid not continue with that.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> it gave me the one or more aruguments out of range.
My guess is that the problem was with the value of the rand parameter.
It is my expectation that you generate rand within [1..<NoOfElements>] range while .GetListItem() method is zero based (i.e. it is in the [0..<NoOfElements> - 1] range), thus, if my guess is correct, then the code should be
aqString.GetListItem(curobject.FullText, rand - 1)
/Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dev dont have any solution for this. But as per earlier suggestion i tired to copy the list to clipboard. How to select a random line from it Can u help me on that?

- « Previous
-
- 1
- 2
- Next »
- « Previous
-
- 1
- 2
- Next »