|
The description in the document is already very clear
The dll file is declared in the implementation below in the program
function Rcard(rdata:pchar;track:integer):integer;stdcall;external'JINCARD7.dll';
function Wcard(wdata:pchar;track:integer):integer;stdcall;external'JINCARD7.dll';
//Main program:
if 1 = Init_com('1,9600,n,8,1') then //Initialize the port successfully
begin
if 1 = Rcard(rdata,5) then //Call the read function in the library, read two or three tracks, if successful
begin
i:=pos ('a',rdata);
strlcopy(str2,rdata,i-1); //Copy the content of track two in str2
strcopy(str3,rdata+i); //Copy the contents of track three in str3
ShowMessage('Successfully read card!'); //Display the successful card reading dialog
end;
wdata:= '2222222222a333333333';
if 1 = Wcard(wdata,5) then //Call the write function in the library to write two or three tracks, if successful
begin
ShowMessage('Successfully write card!'); //Display the successful card writing dialog box
end;
end; //Determine the status of card writing based on the value returned by Wcard function |
|