FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Calculator
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Calculator
Posted: Fri Apr 23, 2010 08:37 PM
The power of macros -one line of code and a powerful calculator is ready.
Best regards,
Otto









prg-file

Code (fw): Select all Collapse
#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 (fw): Select all Collapse
// Add this to your resources RC file

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

#ifdef __64__
   1 24 "WinXP/WindowsXP.Manifest64"
#endif
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Calculator
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Calculator
Posted: Sat Apr 24, 2010 12:13 PM

nice too

FWH .. BC582.. xharbour

Continue the discussion