04-16-2010 04:24 AM
04-16-2010 04:26 AM
Here's a VI that breaks down a string into an array of words and punctuation. (8.6)
(png of block diagram attacked for users in pre 8.6 - I'm sure you can work out what the other cases do!)
Hope this helps
James
(The problem I found recently with the search and replace function it that it doesn't take account of punctuation. This method does.)
04-16-2010 04:31 AM
04-16-2010 05:10 AM
One thing to note Chod,
just as you marked my code as the solution, I was playing with putting the pig latin subvi at then end of my code. You really shouldn't handle the numbers, punctuantion and other ascii charaters in the subVI if you do this (or if you do, handle them carefully.)
Try your code with strings like:
I bought 1 apple.
R U there 2nite?
- that sort of thing (try and break it.)
If you can't, you've got good code
- Thats why I handled the punctuation like that.
James
04-16-2010 05:44 AM
Hi Chod,
attached you'll find another solution.
Mike
04-16-2010 06:40 AM
Hi Chod,
I've attached an updated version of the original VI I posted which calls your Pig Latin subVI and fixes a bug in the original VI I just found.
I think this should do exactly what you want.
James
04-16-2010 06:40 AM
Thanks a ton guys! I was able to fix my issues!
James, yeah I can't do stuff like that, but if it's correct english my program can handle it 🙂
04-16-2010 07:29 AM
Chod wrote:
Thanks Yam! that worked like a charm! I'm only having one problem now. What do I wire to N i manually am putting in the different numbers to match my string length but i need it to be able to change any string of any length.
You dont. 😉 You make it a while loop and Stop when Match is an empty string. The loop counter I will be the number of words (of ofc the length of the new array)
/Y
04-16-2010 07:57 AM - edited 04-16-2010 08:01 AM
Edit, oops.
Good responses everyone