shade
Client
- Регистрация
- 19.11.2010
- Сообщения
- 580
- Благодарностей
- 346
- Баллы
- 63
Hi bigcajones.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:
This is recorded while making the template, but when I run the debug, everything works okay but this. Hopefully you can help.Код:he.SetValue(instance.RiseMacros("String.Split", new [] { "", "File.GetString", "\\Resources\\email.txt", "random", "false", "", ":", "0" }), true);
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" })
Код:
instance.RiseMacros("String.Split", new [] { instance.RiseMacros("File.GetString", new [] { "\\Resources\\email.txt", "random", "false" }), "@", "0" })
Код:
he.SetValue(instance.RiseMacros("String.Split", new [] { instance.RiseMacros("File.GetString", new [] { "\\Resources\\email.txt", "random", "false" }), "@", "0" }) ,true)
Any questions?