Jump to content
Fivewin Brasil

>> TDOSPRN -> String Overflow <<


Anderson.OL

Recommended Posts

citação:

Anderson, enviei novamente para o endereço sac@rcasistemas.com.br

Kleyton

Clipper5.2E+Clipper5.3b+Blink7+FW2.0d

cleitonbala@bol.com.br


id=quote>id=quote>

Kleyton, a sua classe parece aceitar o que eu quero, sendo que está dando um erro de Array Access, veja abaixo:

Error BASE/1068 Argument error: array access

Args:

[ 1] = A { ... } Array

[ 2] = U

...

Called from TDOSPRN:END(624)

Abraços

Nesse mundo nada se cria, tudo se compila<<

//--Clipper 5.3b / FiveWin 2.6 / Blinker 7.0 --//

//--

_Dom Quixote_

RO Iris Server / Agility Kina / 7*/3*

Link to comment
Share on other sites

Olá Anderson.Ol

O Problema é q vc precisa ressetar a impressão senão a TDosPrn vai estourar, não têm jeito, se vc inicializar a impressora isso para de ocorrer, estou postando um código que eu uso.

Eu formato a impressora para trabalhar como se cada etiqueta fosse uma página, repare no CHR(27)+....

/****************************************************************************/

/* Emissao de Etiquetas */

/* Programador - Vagner Wirts */

/* Programa - Fat3_030.Prg */

/****************************************************************************/

//

#Include "FiveWin.Ch"

/*---------*/

Proc Fat3_030()

Local lOk1,lOk2

Close Data

lOk2 := Abre(cArqu_Cobra+".Dbf\Duplicat",{cArqu_Cobra+".Cdx\Dupl_Dup",cArqu_Cobra+".Cdx\Dupl_Fil",cArqu_Cobra+".Cdx\Dupl_Nom",cArqu_Cobra+".Cdx\Dupl_Bco"},"Duplicat")

lOk1 := .F.

Do Whil .T.

Use \Tr1Wells\Arquivos\Arqu_Ger.dbf\Clientes New Share Alias Clientes

Set Inde To \Tr1Wells\Arquivos\Arqu_Ger.cdx\Clientes

If Used()

lOk1 := .T.

Exit

Endif

Enddo

If !lOk1.or.!lOk2

Close Data

Retu("")

Endif

oFatIni := nFatIni := 0

oFatFin := nFatFin := 0

Define Font oFont Name "Ms Sans Serif" Size 6 ,7

Define Dialog oFat3030 From 53,53 To 120,334 Pixel Title "Emissão de Etiquetas" Font oFont

@ 000,001 To 018,140 Of oFat3030 Pixel Label "Faturas"

@ 008,003 Say "Inicial" Pixel Size 026,08

@ 008,020 Get oFatIni Var nFatIni Pict "999999" Pixel Size 022,07 Font oFont Valid(FatInic())

@ 008,100 Say "Final" Pixel Size 026,08

@ 008,116 Get oFatFin Var nFatFin Pict "999999" Pixel Size 022,07 Font oFont

@ 020,002 Dbutton oBut1 Prompt "&Confirma" Name "OpcaoSim" Of oFat3030 GLIP POS 7 Size 40,14 Action(ImpEti()) ToolTip "Confirma os Dados"

@ 020,100 Dbutton oBut4 Prompt "&Sair" Name "OpcaoSai" Of oFat3030 GLIP POS 7 Size 40,14 Action(oFat3030:End()) ToolTip "Sai da Listagem"

Activate Dialog oFat3030 Center

Close Data

Retu("")

/*---- Funcao para pegar a Primeira Duplicata -----*/

Static Func FatInic()

If Empty(nFatIni)

oFat3030:End()

Retu(.T.)

Endif

Sele Duplicat

Seek StrZero(nFatIni,6)

If !Found()

MsgAlert("Fatura Inicial Não Encontrada.","Atenção !!")

Retu(.F.)

Endif

Retu(.T.)

/*--------- Funcao para Imprimir Faturas --------*/

Static Func ImpEti()

If !Isprinter()

MsgAlert("A Impressora Não Está Respondedo."+CRLF+"Verifique Se Está Ligada.","Atenção !!")

Retu("")

Endif

cFatF := StrZero(nFatFin,6)

Sele Duplicat

Seek StrZero(nFatIni,6)

nLin := 1

oPrin := TDosPrn():New()

Do Whil .T.

lSn := SimNao("Teste de Alinhamento ?","Atenção !!")

If !lSn ; Exit ; Endif

oPrin:StartPage()

@ 0000,00 PSay Chr(27)+"@"+Chr(27)+"C"+Chr(10)+Chr(18)

nLin := 1

@ nLin,00 PSay "A/C"

@ nLin,43 PSay "A/C"

// @ nLin,87 PSay "A/C"

nLin ++

@ nLin,00 PSay Repl("X",40) // Contato

@ nLin,43 PSay Repl("X",37)

// @ nLin,87 PSay Repl("X",40)

nLin ++

@ nLin,00 PSay Repl("X",40) // Nome

@ nLin,43 PSay Repl("X",37)

// @ nLin,87 PSay Repl("X",40)

nLin ++

@ nLin,00 PSay Repl("X",40) // Endereco

@ nLin,43 PSay Repl("X",37)

// @ nLin,87 PSay Repl("X",40)

nLin ++

@ nLin,00 PSay Repl("X",20) // Bairro

@ nLin,43 PSay Repl("X",20)

// @ nLin,87 PSay Repl("X",20)

nLin ++

@ nLin,00 PSay Repl("X",25)+"/XX" // Cidade/Estado

@ nLin,43 PSay Repl("X",25)+"/XX"

// @ nLin,87 PSay Repl("X",25)+"/XX"

nLin ++

@ nLin,00 PSay "CEP : 99999-999" // Cep

@ nLin,43 PSay "CEP : 99999-999"

// @ nLin,87 PSay "CEP : 99999-999"

nLin += 2

@ nLin,00 PSay Chr(27)+"@"

oPrin:EndPage()

Enddo

Do Whil !Eof()

*---- Verifica se Refaturamento ou Nao ----*

If lProgNormal == ReFatu

Skip

Loop

Endif

If Situac .or. Left(Observ,6) == "CANCEL" .or. Empty(ValDup)

Skip

Loop

Endif

If Duplic > cFatF

Go Bott

Skip

Loop

Endif

nCon := 1

// aCli := {{" "," "," "," "," "," "," "," "},{" "," "," "," "," "," "," "," "},{" "," "," "," "," "," "," "," "}}

aCli := {{" "," "," "," "," "," "," "," "},{" "," "," "," "," "," "," "," "}}

Do Whil !Eof() .and. nCon < 3

*---- Verifica se Refaturamento ou Nao ----*

If lProgNormal == ReFatu

Skip

Loop

Endif

If Left(Observ,6) == "CANCEL" .or. Empty(ValDup)

Skip

Loop

Endif

If Duplic > cFatF

nCon := 8

Go Bott

Skip

Loop

Endif

cCgc := CgcCpf

Sele Clientes

Seek cCgc

cNom := Nome__

cEnd := EndCob

cBai := BaiCob

cCid := CidCob

cEst := EstCob

cCep := CEPCob

If Atenca

aCli[nCon][7] := "A/C"

aCli[nCon]icon_smile_8ball.gif := Contat

Endif

aCli[nCon][1] := Left(cNom,37)

aCli[nCon][2] := Left(cEnd,37)

aCli[nCon][3] := Left(cBai,37)

aCli[nCon][4] := cCid

aCli[nCon][5] := cEst

aCli[nCon][6] := cCep

nCon ++

Sele Duplicat

Skip

Enddo

oPrin:StartPage()

@ 0000,00 PSay Chr(27)+"@"+Chr(27)+"C"+Chr(10)+Chr(18)

nLin := 1

@ nLin,00 PSay aCli[1][7] // A/C

@ nLin,43 PSay aCli[2][7]

// @ nLin,87 PSay aCli[3][7]

nLin ++

@ nLin,00 PSay aCli[1]icon_smile_8ball.gif // Contato

@ nLin,43 PSay aCli[2]icon_smile_8ball.gif

// @ nLin,87 PSay aCli[3]icon_smile_8ball.gif

nLin ++

@ nLin,00 PSay aCli[1][1] // Nome

@ nLin,43 PSay aCli[2][1]

// @ nLin,87 PSay aCli[3][1]

nLin ++

@ nLin,00 PSay aCli[1][2] // Endereco

@ nLin,43 PSay aCli[2][2]

// @ nLin,87 PSay aCli[3][2]

nLin ++

@ nLin,00 PSay aCli[1][3] // Bairro

@ nLin,43 PSay aCli[2][3]

// @ nLin,87 PSay aCli[3][3]

nLin ++

@ nLin,00 PSay aCli[1][4]+"/"+aCli[1][5] // Cidade/Estado

@ nLin,43 PSay aCli[2][4]+"/"+aCli[2][5]

// @ nLin,87 PSay aCli[3][4]+"/"+aCli[3][5]

nLin ++

@ nLin,00 PSay "CEP : "+aCli[1][6] // Cep

@ nLin,43 PSay "CEP : "+aCli[2][6]

// @ nLin,87 PSay "CEP : "+aCli[3][6]

nLin += 2

@ nLin,00 PSay Chr(27)+"@"

oPrin:EndPage()

Enddo

Retu("")

Vagner Wirts

Clipper 5.2 Lib 5.3 - Blinker 5.0 FW 2.0, Harbour 43.0 (Flex), xHarbour 99.1 99.2 99.3 (Simplex) FW 2.5 icon_smile_big.gif

Link to comment
Share on other sites

Pessoal, vlw pela força, decidi ficar com a classe TDosPrn do Kleiton.

Qto ao erro ao executar o metodo End(), desabilitei a opcao de executar um comando dai ficou tudo certo...

Obrigado e abraço a todos.

Nesse mundo nada se cria, tudo se compila<<

//--Clipper 5.3b / FiveWin 2.6 / Blinker 7.0 --//

//--

_Dom Quixote_

RO Iris Server / Agility Kina / 7*/4*

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...