isolate number from format string with quote ""
Hi all :)
They are the last details of my script (Environment Lighting HDR Studio (MR) ) but now I've a problem that I can not solve...
I want to enter parameters in rollut taking them from a txt file, but the info in file txt are written as Reflections (Subactive Color): (color 255 255 255) or Glossines: 8.0 ecc.. Now I know this form to isolate number from string array:
test = "Max Distance FallOff: 2.0" strArr = filterString test " " valuespinner = strArr[4] as float print valuespinner
but I can not transfer ONLY values in rollout, because I always error of various kinds (!)
If I try with "openFile" and "readValue", (for read the file txt) I've always the result, for example, "scale()", but never specific value. I had no trouble writing values to and from .txt, but now I can not do this..
The question is very simple: How isolate a number from a string with quote "" and restore the values of spinner etc. the rollout reading a file .txt?
Any help is very important to me :D
Thanks
Michele71
Comments
Thanks for the stuff. it is
Thanks for the stuff. it is more like a gift for me to have such content as being fond of the codes.
Thanks barigazy for the link.
Thanks barigazy for the link.
My programming is really basic ( :D ) and anything that can increase the information and study is well accepted! I find Dotnet too difficult for me now...
Thanks for the help and valuable resources!!
Well, with the FN of Barigazy
Well, with the FN of Barigazy I've solved many parameters that work very well, while for the pickcolor, don't find solution. The suggestion of pixamoon
does not work. With the fn I have always the result of 0.0...
I keep (work permitting) to seek solution :)
ah
ah, because last value has ")" -> "127.5)"
you need to remove ")" and then convert to float
Heheheheh I have noticed of
Heheheheh I have noticed of this :D The problem is that then the development there is always something wrong... your advice anyway are very useful, I discovered things I did not know :) thanks!!!
`
something like this: ?
WoW! thanks, now try it! :)
WoW! thanks, now try it! :)
`
great :)
but this is starting to be complicated reading, maybe it will be better to format differently on save so you get: (with "|" quote)
name|value
or for color
name|value|value|value <- format "%|%|%|%" a.name a.color.red a.color.green a.color.blue
Than will be very easy to read single values
Hahahahah yes, you're right
Hahahahah yes, you're right :D
Unfortunately took an unexpected direction, I did not think of creating a command to reload for spinner, but I am learning a lot from this.
However your advice WORK and I am very happy, even if it is a bit "confusing" :)
Thanks a lot! really !!
`
yes, me too. this was nice brain training :)
One more idea for saving settings is .ini file. But you know this probably.
It looks very easy with code:
setINISetting IniFIle "Settings" "glossines" (value as string)
getINISetting IniFile "Settings" "glossines"
I think I'll be using ini or xml :)
Best,