Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 11:48 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Word Frequency in text object
PostPosted: October 2nd, 2014, 2:59 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Yep,

re-initializing the array when replacing the listbox selection with "" solves it.

Code:
myWordsArray = new Array();


Thanks Mack.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: Word Frequency in text object
PostPosted: October 2nd, 2014, 11:56 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Any way to remove blank spaces in the listbox that are being added when there is whitespace in the textbox?

These blank spaces (which also have word counts) throw off the listbox selection. Items below a whitespace entry in the listbox don't select the correct words.

Tried different scripts to try to stop whitespace from being added to the listbox. No success after a week at it.

For example, this script did not work to solve the problem:

Code:
if (myWords.charAt(a) == ""){
   tW = myWords[a].GetSelection();
   myWords[a].SetSelection(tW.start,tW.end);
   myWords[a].ReplaceSelection("");
   }


Also tried the following script in the checkWord() function with no success:

Code:
for (g = 0;g<myWordsArray.length;g++){
tmpCode = myWordsArray[g].word.charCodeAt(g)
if  (tmpCode == 32){
tmpFound = true
}
}


attached screenshot with nonsense text in text box and listbox with gaps:

Attachment:
screenshot1.jpg


Any suggestions appreciated.


You do not have the required permissions to view the files attached to this post.

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group