it's easier to explain it on another function, which also contains a struct with an array of integer-element ( int CSVFeld[30]; )
Code: Select all
#include "Fivewin.ch"
function main()
local aConvertCSV2XML
msgInfo(SEPATOOLS_INIT( "", "", "c:\temp", "", 0 ))
aConvertCSV2XML := SEPATOOLS_CONVERTCSVTOXML({ "C:\Users\panitz\Documents\Mappe1.csv", "C:\Temp\XML\XML1.xml", "27092014",;
"", 0, 0, "TomSchmidt", "", "", "", "", "", "", "", "", 123,;
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0},;
";", "", "", "", ""})
msgInfo( aConvertCSV2XML )
return nil
#pragma begindump
#include <hbapi.h>
#include <windows.h>
// INIT-Function
int pascal SepaTools_Init(const char *DataPath, const char *TempPath, const char *UserPath, const char *Lizenz, int Netz);
HB_FUNC (SEPATOOLS_INIT)
{
hb_retni( SepaTools_Init( hb_parc( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parc( 4 ), hb_parni( 5 ) ) );
}
// CONVERTCSVTOXML - Function
typedef struct
{
char InputFile[255+1];
char OutputFile[255+1];
char AusfDatum[8+1];
char Kennung[10+1];
int Lastschrift;
int B2B;
char Einreicher[70+1];
char AuftragName[70+1];
char AuftragBLZ[8+1];
char AuftragKonto[11+1];
char AuftragBIC[11+1];
char AuftragIBAN[35+1];
char CI[35+1];
char Mandat[35+1];
char MandatDat[8+1];
int MandatStart;
int CSVFeld[30];
char Trennzeichen[1+1];
char Grenze[1+1];
char Tausend[1+1];
char Komma[1+1];
char Reserve[200];
} CSVConvertStruct30;
int pascal SepaTools_ConvertCSVtoXML( const CSVConvertStruct30 *CSVConvert );
HB_FUNC( SEPATOOLS_CONVERTCSVTOXML )
{
int k, l;
CSVConvertStruct30 aStruct;
strcpy( aStruct.InputFile, ( char * ) hb_parc( 1, 1 ) );
strcpy( aStruct.OutputFile, ( char * ) hb_parc( 1, 2 ) );
strcpy( aStruct.AusfDatum, ( char * ) hb_parc( 1, 3 ) );
strcpy( aStruct.Kennung, ( char * ) hb_parc( 1, 4 ) );
aStruct.Lastschrift = hb_parni( 1, 5 );
aStruct.B2B = hb_parni( 1, 6 );
strcpy( aStruct.Einreicher, ( char * ) hb_parc( 1, 7 ) );
strcpy( aStruct.AuftragName, ( char * ) hb_parc( 1, 8 ) );
strcpy( aStruct.AuftragBLZ, ( char * ) hb_parc( 1, 9 ) );
strcpy( aStruct.AuftragKonto, ( char * ) hb_parc( 1, 10 ) );
strcpy( aStruct.AuftragBIC, ( char * ) hb_parc( 1, 11 ) );
strcpy( aStruct.AuftragIBAN, ( char * ) hb_parc( 1, 12 ) );
strcpy( aStruct.CI, ( char * ) hb_parc( 1, 13 ) );
strcpy( aStruct.Mandat, ( char * ) hb_parc( 1, 14 ) );
strcpy( aStruct.MandatDat, ( char * ) hb_parc( 1, 15 ) );
aStruct.MandatStart = hb_parni( 1, 16 );
for ( k = 0; k < 30; k++ ) {
l = k+1;
aStruct.CSVFeld[k] = hb_parni( 1, 17, l );
}
strcpy( aStruct.Trennzeichen, ( char * ) hb_parc( 1, 18 ) );
strcpy( aStruct.Grenze, ( char * ) hb_parc( 1, 19 ) );
strcpy( aStruct.Tausend, ( char * ) hb_parc( 1, 20 ) );
strcpy( aStruct.Komma, ( char * ) hb_parc( 1, 21 ) );
strcpy( aStruct.Reserve, ( char * ) hb_parc( 1, 22 ) );
hb_retni( SepaTools_ConvertCSVtoXML( &aStruct ) );
}
#pragma enddump