To get started with USoft Blend, all you need is an installation of the USoft platform.
1. | Click the Windows Start button, then type "cmd". |
2. | Right-mouse click on the "Command Prompt - Desktop app" item and choose Run As Administrator. |
3. | In the Administrator: Command Line window, at the prompt, type: |
> cd working-dir
| where working-dir is an unimportant lab directory where you can try out new things, for example: |
> cd c:\tryout\blend
4. | Using a text editor, create a text file in the try-out directory you have chosen. Give the file an appropriate name, for example, blend.xml, and make sure that its contents read like this: |
<example xmlns:pc="Processing.Command" pc:hideme="false">
<pc:ConsoleWrite>Hello World!</pc:ConsoleWrite>
</example>
|
5. | Find out where your USoft BIN dir is. This is the \BIN64 subdirectory of your USoft installation directory, or the \BIN subdirectory if you have a 32-bit installation. |
6. | In the "Administrator: Command Line" window, at the prompt, type: |
c:\tryout\blend> usoft-bindir\ublendit.exe blend.xml
| Press Enter. This passes your blend.xml script to the USoft Blend processor. |
7. | See that the result is: |
<example xmlns:pc="Processing.Command" pc:hideme="false">
Hello World!
</example>
|
8. | In the script, set pc:hideme="true" instead of pc:hideme="false". Save work. |
9. | Re-run the script: select the "Administrator:Command Line" window again, press the Arrow-Up key, which brings your more recently used command back to the prompt, and then press Enter. See that the result is: |
|
This example performs a useful task. It deletes a file from your file system. In the same way, you can have Blend scripts that connect to USoft applications, create or drop tables or even entire databases, import data, perform file system and other OS operations, export and zip your application tables, compare your repositories...
1. | Click the Windows Start button, then type "cmd". |
2. | Right-mouse click on the "Command Prompt - Desktop app" item and choose Run As Administrator. |
3. | In the Administrator: Command Line window, at the prompt, type: |
> cd working-dir
| where working-dir is an unimportant lab directory where you can try out new things, for example: |
> cd c:\tryout\blend
4. | Using a text editor, create a text file in the try-out directory you have chosen. Give the file an appropriate name, for example, blend.xml, and make sure that its contents read like this: |
<example xmlns:pc="Processing.Command">
<pc:assign workingdir="{directories:Get()}"/>
<pc:assign deletefile="{path:Combine($workingdir,'deletethis.txt')}"/>
<pc:DeleteFile source="{$deletefile}"/>
</example>
|
5. | Create some dummy text file in the try-out directory. Give the file the name of deletethis.txt. This file does not need to have any content. |
6. | Find out where your USoft BIN dir is. This is the \BIN64 subdirectory of your USoft installation directory, or the \BIN subdirectory if you have a 32-bit installation. |
7. | In the Administrator: Command Line window, at the prompt, type: |
c:\tryout\blend> usoft-bindir\ublendit.exe blend.xml
| Press Enter. This passes your blend.xml script to the USoft Blend processor. |
8. | See that the result on the console is: |
<example xmlns:pc="Processing.Command" pc:hideme="false">
<!--files:DeleteFile(c:\myworkingdir\deletethis.txt) -->
</example>
|
9. | See that the result in the file system is that the deletethis.txt file has been removed. |
|
See also
Introducing USoft Blend
USoft Blend scripts
|