Get Error Contents

By using function AioGetErrorString, it is possible to convert error code to a character string for all functions.
The character string used by function AioGetErrorString is 256 bytes at most.

Programming Example in Visual Basic .NET

Dim Ret As Integer
Dim ErrorRet As Integer
Dim Id As Short
Dim ErrorString As New StringBuilder("", 256)

Ret = AioInit( "AIO000" , Id )
ErrorRet = DioGetErrorString( Ret , ErrorString )
System.Diagnostics.Debug.WriteLine( "AioInit: " & ErrorString )

Ret = AioExit( Id )
ErrorRet = DioGetErrorString( Ret , ErrorString )
System.Diagnostics.Debug.WriteLine( "AioExit: " & ErrorString )

Programming Example in Visual C#

int Ret;
int ErrorRet;
short Id;
string ErrorString;

Ret = aio.Init( "AIO000", out Id );
ErrorRet = aio.GetErrorString( Ret , ErrorString );
System.Diagnostics.Debug.WriteLine( "AioInit: " + ErrorString );

Ret = aio.Exit( Id );
ErrorRet = aio.GetErrorString( Ret , ErrorString );
System.Diagnostics.Debug.WriteLine( "AioExit: " + ErrorString );

Programming Example in Visual C++ (MFC)

long Ret;
long ErrorRet;
short Id;
char ErrorString[256];

Ret = AioInit( "AIO000" , &Id );
ErrorRet = DioGetErrorString( Ret , ErrorString );
printf("AioInit : %s", ErrorString );

Ret = AioExit( Id );
ErrorRet = DioGetErrorString( Ret , ErrorString );
printf("AioExit : %s", ErrorString );

Programming Example in Python

Ret = ctypes.c_long()

ErrorRet = ctypes.c_long()

Id = ctypes.c_short()

ErrorString = ctypes.create_string_buffer(256)

 

Ret.value = caio.AioInit ( b"AIO000" , ctypes.byref(Id) )

ErrorRet.value = caio.AioGetErrorString( Ret, ErrorString )

print( f"AioInit : {ErrorString.value.decode('sjis')}" )

 

Ret.value = caio.AioExit ( Id )

ErrorRet.value = caio.AioGetErrorString( Ret, ErrorString )

print( f"AioExit : {ErrorString.value.decode('sjis')}" )