Argox Label Printer: A_Prn_Text - Variable Is Error

0

Follow the function:

function  A_Prn_Text     ( x,y,ori,font,typee,hor_factor,ver_factor:integer;mode:char;numeric:integer;data:String):integer;stdcall;external 'WINPPLA.DLL';

Follow the code:

while not DMRetaguarda.QConItem.eof do
begin
  for i := 1 to strtoint(edit5.text) do
    begin
      A_Prn_Text(200, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString(copy(dmretaguarda.qconitemdescricao.asstring, 1, 29))));
      if length(dmretaguarda.qconitemdescricao.asstring) > 29 then
        A_Prn_Text(180, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString(copy(dmretaguarda.qconitemdescricao.asstring, 30, 29))));
      A_Prn_Text(175, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString('____________________________________')));
      A_Prn_Text(150, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString('MARCA: '+copy(dmretaguarda.qconitemmarca.asstring, 1, 30))));
      A_Prn_Text(130, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString('MODELO: '+copy(dmretaguarda.qconitemmodelo.asstring, 1, 30))));
      A_Prn_Text(110, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString('REF.: '+copy(dmretaguarda.qconitemreferencia.asstring, 1, 35))));
      loc12 := dmretaguarda.qconitemlocal1.asstring;
      if dmretaguarda.qconitemlocal2.asstring <> '' then
        loc12 := loc12 + ' e '+dmretaguarda.qconitemlocal2.asstring;
      A_Prn_Text(85, 360, 0, 9, 5, 1, 1, 'n', 2, PWideCHar(AnsiString('LOCAL: '+loc12)));
      A_Prn_Text(20, 180, 0, 9, 6, 0, 1, 'n', 2, PWideCHar(AnsiString('COD.: '+copy(dmretaguarda.qconitemcodigo.asstring, 7, 7))));
      A_Prn_Barcode(10, 360, 0, 'E', 0, 0, 60, 'A', 1, PWideCHar(AnsiString(dmretaguarda.qconitemcodigo.asstring)));
      A_Print_Out(1, 1, 1, 1);
    end;
  DMRetaguarda.QConItem.next;
end;

This code should print according to my coordinates, which from the query that is running will assign the values that I typed in my form, however it is giving this error in the first line:

Could anyone tell me what that could be?

    
asked by anonymous 24.07.2014 / 14:59

1 answer

1
while not DMRetaguarda.QConItem.eof do
begin
  for i := 1 to strtoint(edit5.text) do
    begin
      A_Prn_Text(200, 360, 1, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString(copy(dmretaguarda.qconitemdescricao.asstring, 1, 29))));
      end;
end;

According to my function above that I researched a lot, the problem is that only 1,2,3 and 4 are allowed.

I just changed the numbering of ori , of the function:

function  A_Prn_Text     ( x,y,ori,font,typee,hor_factor,ver_factor:integer;mode:char;numeric:integer;data:String):integer;stdcall;external 'WINPPLA.DLL';

and it worked: D

    
28.07.2014 / 18:48