shade
Client
- Регистрация
- 19.11.2010
- Сообщения
- 580
- Реакции
- 346
- Баллы
- 63
Shade, thanks so much for your help and your projects. Can you explain how to use the macros for get file and split string. In my template I have this:
Код:he.SetValue(instance.RiseMacros("String.Split", new [] { "", "File.GetString", "\\Resources\\email.txt", "random", "false", "", ":", "0" }), true);
This is recorded while making the template, but when I run the debug, everything works okay but this. Hopefully you can help.
Hi bigcajones.
I will give a detailed explanation.
Method instance.RiseMacros takes two parameters, name of macros (for example "Person.FirstName" - it's a string value) and array of string (it's all parameters of current macros)
Macros String.Split in code look like this:
Код:
instance.RiseMacros("String.Split", new [] { "some:text", ":", "0" })
1. "String.Split" - it's macros name
2. new [] - it's means that will be create a new array (array of parameters)
3. {..., ..., ...} - initialization of array (all parameters have a string value and specified using a comma. Nothing else in the parameters can not be.)
4. "some:text" - it's text (string) which will be split.
5. ":" - char or string which divides text.
6. "0" - index of string which will be returned.
If you want the result of a macros passed as a parameter then you should replace this parameter on method of macros execution. For example I replaced "some:text" on
Код:
instance.RiseMacros("File.GetString", new [] { "\\Resources\\email.txt", "random", "false" })
In code it's should look like this:
Код:
instance.RiseMacros("String.Split", new [] { instance.RiseMacros("File.GetString", new [] { "\\Resources\\email.txt", "random", "false" }), "@", "0" })
instance.RiseMacros always returns a string value and you can use it for he.SetValue
Код:
he.SetValue(instance.RiseMacros("String.Split", new [] { instance.RiseMacros("File.GetString", new [] { "\\Resources\\email.txt", "random", "false" }), "@", "0" }) ,true)
I hope it's that you need.
Any questions?


