HOW TO PRINT CHECK

HOW TO PRINT CHECK

Postby patili » Tue Oct 09, 2007 7:01 am

Hi everybody
i am looking to print bank checks with a "normal" printer (Lexmark laser Optra 310)
Have any idea of how make conversion beetween numbers and letters
( 100 euros will give cent euros , 54 will give cinquante quatre....)?
Thanks
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Re: HOW TO PRINT CHECK

Postby Enrico Maria Giordano » Tue Oct 09, 2007 8:16 am

I wrote a function years ago but it is in Italian. Do you want to see it anyway?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby patili » Tue Oct 09, 2007 11:48 am

Yes may be i will be able to translate from italian to french
Thanks
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Postby Enrico Maria Giordano » Tue Oct 09, 2007 12:09 pm

Sent to your private email.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

I HOPE THIS IS IT

Postby avista » Tue Oct 09, 2007 12:25 pm

// Testing

#include "FiveWin.ch"

//------------------------------------------------------------------------//

function Main()

local oDlg
local oGet
local nGet := 0

DEFINE DIALOG oDlg TITLE "Number To Word"

@ 5, 5 SAY "Number:" OF oDlg PIXEL
@ 5, 50 GET oGet VAR nGet OF oDlg SIZE 35, 12 PIXEL PICTURE "999999999999"

@ 25, 5 BUTTON "&Word" OF oDlg SIZE 35,12 ACTION Convert(nGet) PIXEL
@ 25, 50 BUTTON "&End" OF oDlg SIZE 35,12 ACTION oDlg:End() PIXEL

ACTIVATE DIALOG oDlg CENTERED

return nil

//------------------------------------------------------------------------//

function Convert(nGet)

local cWords := ""
local nRest := 0
local nNum := 0

cDigits := { "one ", "two ", "three ", "four ", "five " ,;
"six ", "seven ", "eight ", "nine ", "ten " ,;
"eleven ", "twelve ", "thirteen ","fourteen ","fifteen " ,;
"sixteen ", "seventeen ","eighteen ","nineteen " ;
}

cTens := { "twenty ", "thirty ", "forty ", "fifty ","sixty " ,;
"seventy ", "eighty ", "ninety " ;
}

nRest := nGet

IF nRest > 999999999
nNum := INT(nRest/1000000000)
nRest := nRest - INT(nRest/1000000000)*1000000000
cWords := cWords + Text(nNum) + "billion "
ENDIF
IF nRest > 999999
nNum := INT(nRest/1000000)
nRest := nRest - INT(nRest/1000000)*1000000
cWords := cWords + Text(nNum) + "million "
ENDIF
IF nRest > 999
nNum := INT(nRest/1000)
nRest := nRest - INT(nRest/1000)*1000
cWords := cWords + Text(nNum) + "thousand "
ENDIF
IF nRest > 0
nNum := nRest
cWords := cWords + Text(nNum)
ENDIF

msginfo(cWords)

return nil

//------------------------------------------------------------------------//

function Text(nNum)

local cText := ""

IF nNum > 99
cText := cText + cDigits[INT(nNum/100)] + "hundred "
ENDIF

nRest := nNum - INT(nNum/100)*100

IF nRest > 0
IF nRest < 20
cText := cText + cDigits[nRest]
ELSE
cText := cText + cTens[INT(nRest/10)-1]
IF nRest - INT(nRest/10)*10 > 0
cText := cText + cDigits[nRest-INT(nRest/10)*10]
ENDIF
ENDIF
ENDIF

return cText
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Postby patili » Tue Oct 09, 2007 6:02 pm

Thanks at you two
I will test this two functions.
regards
Patrick
User avatar
patili
 
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 7 guests