The FileWrite function writes the specified item into the specified file on the MVSP Server.


Namespace: rocketsoftware.MVSP
Assembly: RocketMVSP (in RocketMVSP.dll)

Syntax

Visual Basic (Declaration)
Public Function FileWrite( _ 
   ByVal filePath As String,  _ 
   ByVal itemId As String,  _ 
   ByVal itemBody As String _ 
) As Boolean
C#
public bool FileWrite(
   string filePath,
   string itemId,
   string itemBody
)
C++
public:
 bool FileWrite(
   String filePath,
   String itemId,
   String itemBody
) sealed 
J#
public bool FileWrite(
   string filePath,
   string itemId,
   string itemBody
)
JScript
public  function FileWrite(
   filePath : String,
   itemId : String,
   itemBody : String
) : bool

Parameters

filePath
is the name of the file that you wish to write the item to
itemId
is the Itemid that you wish to write
itemBody
is the item data

Return Value

True

Remarks

If the item could not be written then statuscode and statusmessage properties will be set with the correct error message number and text

Example connects and writes a record 100 to the CUSTOMERS file

 Copy Code
 Dim returncode as boolean
 Dim mvsp as new rocketsoftware.MVSP.Pick
 Dim params as string = ""
 Dim itemid as string = ""
 Dim itembody as string = ""
 Dim am as string = chr(254)
 returncode = mvsp.Connect("localhost",9000,"dm","")
 If returncode = True then
    returncode = mvsp.Logto("MVDEMO","")
    If returncode = True then
       itemid = "100" ' Itemid
       itembody = "Lucky Computers" & am & am & am & am & am & "Fred Smith" & am & "Order Entry Clerk"
       returncode = mvsp.FileWrite("CUSTOMERS", itemid, itembody)       
    End if
 End if
 returncode = mvsp.CloseConnection()
 

See Also