Calculator

Calculator

Postby Otto » Fri Apr 23, 2010 8:37 pm

The power of macros -one line of code and a powerful calculator is ready.
Best regards,
Otto

Image

Image





prg-file

Code: Select all  Expand view
#Include "FiveWin.Ch"

Function Main()
   Local oDlg
   Local oGet
   local cVar := space( 100 )

   DEFINE DIALOG oDlg from 0,0 to 400,400 pixel

   @ 15,15 get oGet var cVar picture "@!"  bitmap "..\bitmaps\chkyes.bmp" action( calc( @cVar ), oGet:refresh() );
      size 120,12 of oDlg pixel
   oGet:lAdjustBtn := .t.

   ACTIVATE DIALOG oDlg

return nil


function calc( cVar )
   local cTempCalc := cVar
   Try
   cVar := ALLTRIM( str( &cTempCalc ) ) + space( 100 )
   CATCH
   msginfo( "Wrong input" )
   End

return nil


rc-file
Code: Select all  Expand view
// Add this to your resources RC file

#ifdef __FLAT__
   1 24 ".\winxp\WindowsXP.Manifest"
#endif

#ifdef __64__
   1 24 "WinXP/WindowsXP.Manifest64"
#endif
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: Calculator

Postby James Bott » Fri Apr 23, 2010 10:35 pm

Otto,

Great contribution. Thanks.

I have a similar one somewhere for dates. You can do, +7 (same day next week), +1 (tomorrow), etc.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Calculator

Postby MdaSolution » Sat Apr 24, 2010 12:13 pm

nice too
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 113 guests