finding an unknown part of the name, etc.

  1. secimname = $'Kontrol_yüz kontrol textsR001'.name as stringstream
  2. secimisim=#()
  3. count=1
  4.  
  5. while not eof secimname do
  6. (
  7. secimisim[count]=readchar secimname
  8. count +=1
  9. )
  10. atoplam = secimisim.count - 22
  11. askon=#()
  12. askon[atoplam+1]=(secimisim[secimisim.count-2] as integer)
  13. askon[atoplam+2]=(secimisim[secimisim.count-1] as integer)
  14. askon[atoplam+3]=(secimisim[secimisim.count] as integer)
  15. for o in 1 to atoplam do
  16. (
  17. askon[o]=(secimisim[o] as string)
  18. )
  19.  
  20. askontoplam=for i in 1 to atoplam collect askon[i] as string
  21.  
  22. askona = (
  23. (askontoplam as string)+"_yüz kontrol textsR" + (askon[atoplam+1]as string + askon[atoplam+2] as string+askon[atoplam+3] as string)
  24. )
  25. askona

output : "#("K", "o", "n", "t", "r", "o", "l")_yüz kontrol textsR001"
but I want to like it: "Kontrol_yüz kontrol textsR001"

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
yunusbbayram's picture

thank you

thank you

Anubis's picture

!?...

I can't catch the meaning of this question...
as your example start and end with no changes:

"Kontrol_yüz kontrol textsR001" -- our object name
"Kontrol_yüz kontrol textsR001" -- our wanted result

They equal! theObj.name , nothing for search in this task?...

As for "finding an unknown part of the name" --
If you search for a part of the name,
then here is 2 examples:

obj = box name:"Happy New Year"
oName = obj.name
 
-- if need boolean test, use matchPattern
matchPattern oName pattern:"*new*" -- true
matchPattern oName pattern:"*hey*" -- false
 
-- if need the position of the string...
findString oName "new" -- 7
findString oName "hey" -- 0 (== not found)

my recent MAXScripts RSS (archive here)

raphick's picture

Hi! Try this one : askona =

Hi! Try this one :

askona = "";
for letter in askontoplam do askona += letter;
askona += "_yüz kontrol textsR" + askon[ atoplam + 1] + askon[ atoplam + 2] + askon[ atoplam + 3];

[Edit]Oops sorry for double answer;

kilad's picture

name = "" for i in

name = ""
for i in askontoplam do name += i

askona = name +"_yüz kontrol textsR" + ....

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.