Article Details

ID: 205
Case Type: faq
Category: Debugging
Related To: ORCAstra
Family: All FPGA

Search Answer Database

Search Text Image

Can ORCAstra access and manipulate data in a file from a Script Window or Visual Window?

Yes; since Script Windows and Visual Windows are built on the Microsoft Windows scripting capability, anything that can be done via Windows Scripting can be done in ORCAstra.


Here is a quick tutorial, using VBScript (knowledge of VBScript basics is assumed):


File I/O capability in VBScript is built on an object called FileSystemObject. In order to access its properties and methods, it is necessary to instantiate the object in your code, like this:



Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")


Now you can use FileSystemObject to create/open files, edit these files, and inspect the files' properties. For example, the following code creates a text file, writes text to it, and closes it:



Const ForReading=1, ForWriting=2, ForAppending=8, CreateIfNecessary=True
Dim F
Set F = FSO.OpenTextFile("C:\Example.txt", ForWriting, CreateIfNecessary)
F.Write "Hello World"
F.Close


Of course, this is not at all an exhaustive treatment, but it gives an idea of what can be done. For complete information, obtain a copy of Microsoft's VBScript documentation directly from their website.