GERANDO SENHA SEQUENCIAL COM O PRINT

RAMALHEIRA 22/09/2012 08:00:41
#410227
Olá colegas, preciso colocar uma solução em um programa, que ele ao emitir o cupom (não fiscal), faça tbm a impressão nesse cupom de uma [Ô]Senha de Chamada[Ô], estilo o que existe em restaurantes de shopping, que vc fica morrendo de fome e esperando teu numero aparecer no display.
Então, como é uma solução bem urgente pensei no seguinte, da mesma forma que posso usar o comando Print - [Ô]date[Ô] e [Ô]Time[Ô], existe algum que me gere um numero sequencial para usar como a senha???
Valeu galera. abraços
RAMALHEIRA 23/09/2012 22:46:02
#410307
Para ilustrar melhor (afinal sou péssimo para explicações...rss) estou inserindo a estrutura que tenho hoje no meu form...

[ô]IMPRIMIR NA IMPRESSORA OUTRAS:
If sIMPRESSORA = [Ô]GENERICA[Ô] Then
Printer.Print [Ô][Ô]
Printer.Print [Ô] -- Pedido -- [Ô]
Printer.Print [Ô] NAO VALE COMO CUPOM FISCAL [Ô]
Printer.Print [Ô] Data/Hora: [Ô] & Format(Date, [Ô]dd/mm/yy[Ô]) & [Ô] [Ô] & Time
[txt-color=#e80000]E AQUI EU QUERIA COLOCAR ALGO QUE QUE FIZESSE A IMPRESSÃO DE UM CÓDIGO DE 001 ATé 999 E AO CHEGAR A 999, VOLTAR A 001[/txt-color]
Printer.Print TRACINHOS
Printer.Print frmCheck.txtUltimosItens.Text
Printer.Print TRACINHOS
Printer.Print [Ô] SUB-TOTAL: [Ô] & txtCompra.Text
If txtEntrada.Text > 0 Then Printer.Print [Ô] Entrada: [Ô] & txtEntrada.Text
Printer.Print [Ô] Juros/Financ.: [Ô] & MOEDA(txtValorTotal.Text - 0 + txtEntrada.Text - txtCompra.Text)
Printer.Print [Ô] TOTAL: [Ô] & txtValorTotal.Text
Printer.Print [Ô] Vencimento: [Ô] & mskVencimento.Text
Printer.Print TRACINHOS
Printer.Print [Ô] Cliente: [Ô] & Left(dbCliente.Text, 29)
If sCpfCgc <> [Ô][Ô] Then Printer.Print [Ô] CPF/CNPJ: [Ô] & sCpfCgc
If sEnder <> [Ô][Ô] Then Printer.Print [Ô] [Ô] & Left(sEnder, 38)
If sBairro <> [Ô][Ô] Or sCidade <> [Ô][Ô] Then Printer.Print [Ô] [Ô] & Left(Left(sBairro, 15) & [Ô] - [Ô] & sCidade & [Ô]-[Ô] & sEstado, 38)
Printer.Print [Ô] Comprador: [Ô] & sQualComp
Printer.Print [Ô] Operador: [Ô] & sOPERA
With TABINDICE
If !MSG1 <> [Ô][Ô] Then
Printer.Print TRACINHOS
Printer.Print [Ô] [Ô] & Left(!MSG1, 38)
End If
If !MSG2 <> [Ô][Ô] Then Printer.Print [Ô] [Ô] & Left(!MSG2, 38)
If !msg3 <> [Ô][Ô] Then Printer.Print [Ô] [Ô] & Left(!msg3, 38)
If !msg4 <> [Ô][Ô] Then Printer.Print [Ô] [Ô] & Left(!msg4, 38)
End With
Printer.Print TRACINHOS
Printer.Print [Ô] [Ô] & Left(sEMPRESA, 38)
Printer.Print [Ô] [Ô] & Left(sENDERECO, 38)
Printer.EndDoc
End If

Espero que tenha conseguido passar para vcs a minha necessidade... e quem sabe ter a ajuda de algum de vcs. Forte abraço
GABRIEL 25/09/2012 21:16:24
#410493
nao sei se entendi
mais veja
ponha isso no começo do soft nas declarações

dim numero as string

e no form onload
numero = [Ô]001[Ô]


e depois so fazer


Printer.Print [Ô] Data/Hora: [Ô] & Format(Date, [Ô]dd/mm/yy[Ô]) & [Ô] [Ô] & Time
[ô] E AQUI EU QUERIA COLOCAR ALGO QUE QUE FIZESSE A IMPRESSÃO DE UM CÓDIGO DE 001 ATé 999 E AO CHEGAR A 999, VOLTAR A 001
[ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô]
if val(numero) > 999 then
numero = [Ô]001[Ô]
else
numero = val(numero)+1
end if

printer.print [Ô]Numero da chamada: [Ô] & numero
[ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô][ô]
Printer.Print TRACINHOS


acho que seria isso
se nao for, me perdoa
RAMALHEIRA 25/09/2012 23:46:43
#410500
Perfeito colega... Nota 10...
Tópico encerrado , respostas não são mais permitidas