Source language: Translate to:

increment a dot

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

increment a dot

Postby schmutly » Sat Sep 26, 2009 7:21 am

Hello Neosoft gurus,
im stuck on the best way to do this:

i simply want to take, say my name
and increment a dot along the name and
spit it out in the filelist ie:
robert =
list:
r.obert
ro.bert
rob.ert
robe.rt
rober.t

i'd appreciate any simplest ideas.
I've searched forum but gave up
after an hour as i dont know how
to express this question :roll:
Thanks for any help,
Robbie
schmutly
 
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Postby Gaev » Sat Sep 26, 2009 8:14 am

schmutly:

NeoBook's String manipulation commands will easily create the different combinations of "dotted words".

What I don't understand is spit it out in the filelist ... did you mean "populate a List Box" ? ... because FileList is a command that "returns a list of files"
User avatar
Gaev
 
Posts: 3733
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby schmutly » Sat Sep 26, 2009 4:46 pm

Hello Gaev ,
yes thats right.
so i can copy/paste each result.
the variable could be 15 characters long.
anyway,Its more of the string manipulation
that clever people like you who
think outside the box can SEE the
solutions too..in your head LOL :D
ill have a reread of the string utilities
esp StrIns and increment that with a
"." in a variable.

Thanks
Robbie
schmutly
 
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm

Postby Gaev » Sun Sep 27, 2009 6:33 am

Robbie:

Try something like this ...
Code: Select all
StrLen "[source]" "[sourceLen]"

If "[sourceLen]" ">" "1"
   ListBoxDeleteItem "ListBox1" "All"
   Loop "2" "[sourceLen]" "[thisPosition]"
      StrIns "!." "[source]" "[thisPosition]" "[thisTarget]"
      ... AlertBox "[source]" "[thisPosition]|[thisTarget]"
      ListBoxAddItem "ListBox1" "0" "[thistarget]"
   EndLoop
EndIf
... where [source] is where the original word is to be found ... and ListBox1 is where the dotted words will be setup.

I have not tested this in my Lab pub (just going by memory) .. so there might be syntax errors ... if you come unstuck, just un-comment the AlertBox command ... and you will be able to see what is happening inside the Loop.
User avatar
Gaev
 
Posts: 3733
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: increment a dot

Postby josesito » Mon Sep 28, 2009 10:22 am

1. Create a ListBox named List
2. Create a Text Entry with the variable [name]
3. Create a PushButton with the following script:

ListBoxDeleteItem "List" "All"
StrLen "[name]" "[nameLen]"
Loop "1" "[nameLen]-1" "[pos]"
SubStr "[name]" "1" "[pos]" "[st1]"
SubStr "[name]" "[pos]+1" "[nameLen]" "[st2]"
ListBoxAddItem "List" "0" "[st1].[st2]"
EndLoop

4. Run it writting the name you want to process.
josesito
 
Posts: 53
Joined: Sat Sep 26, 2009 6:44 pm

Postby schmutly » Sat Oct 03, 2009 11:36 pm

Thanks Gaev and Joseito .... i apologize, i have been away with my boys (school holidays- what about parents needed a break too..lol)

Thanks so much for your help...this is an amazing forum and very generous people too, thank you :)

I will look at these both....
Cheers,

Robbie
schmutly
 
Posts: 217
Joined: Fri Feb 20, 2009 4:16 pm


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 3 guests