FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with Tget
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Problem with Tget
Posted: Thu Jul 12, 2018 10:28 AM
Dear Friends,
I have a get where the final user insert a number but the get write only cr for step from 1 to 9

I not Know why I can insert only one CR on this GET

please compile this small test

Code (fw): Select all Collapse
#include "fivewin.ch"

Static ntotale,nSubTotale,nSconto
Static nAcconto, nDaSaldare

Function test()
Local aget:=array(10)
Local oBrowse:= nil
Local oSay[10]

     ntotale := 0
     nSubTotale := 0
     nAcconto:= 0
     nDaSaldare := 0
     nSconto  := 0

DEFINE DIALOG oDlg SIZE 300, 300 PIXEL

@ 10,5 SAY oSay[5] Prompt "Acconto :" OF  oDlg PIXEL SIZE 70,20 TRANSPARENT
@ 10,75 GET aGet[7] VAR nAcconto  SIZE 40,12 PIXEL OF oDlg PICTURE '@ €99,999.99' ;
     ON CHANGE (aGet[7]:assign(),CalcoloTotali(oBrowse,aGet) )

 @ 40,5 SAY oSay[6] Prompt "Da Saldare :" OF  oDlg PIXEL SIZE 70,20 TRANSPARENT
 @ 40,75 GET aGet[8] VAR nDaSaldare  SIZE 40,12 PIXEL OF oDlg PICTURE '@ €99,999.99' READONLY

ACTIVATE DIALOG oDLG CENTERED
RETURN NIL
//------------------------------------------------------------------------------------------------//


Function CalcoloTotali(oBrowse,aGet)
   Local n
   nTotale:= 0
   nSubtotale:= 0



     nSubTotale:= 18.00    //only for test

     nTotale:=nSubTotale-nSconto
     nDaSaldare:=nTotale-nAcconto



   aGet[7]:refresh()  // acconto
   aGet[8]:refresh()  // da saldare

  * oBrowse:Refresh()
 *  oBrowse:GoBottom()


   return nil




How I can resolve ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Problem with Tget
Posted: Thu Jul 12, 2018 01:27 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Problem with Tget
Posted: Thu Jul 12, 2018 01:28 PM
Code (fw): Select all Collapse
Picture Codes

 Say Picture Functions
 B  Display numbers left-justified    │ X  Display DB after negative numbers
 C  Display CR after positive numbers │ Z  Display zeros as blanks
 D  Display date in SET DATE format   │ (  Enclose negative numbers in parens
 E  Display date in British format    │ !  Convert alpha characters to upper
 R  Insert non-template characters    │
 Say Picture Template Symbols
 A  Display digits for any data type  │ !  Convert alpha character to upper
 N   "                                │ $  Display dollar sign instead of
 X   "                                │    leading space in a numeric
 9   "                                │ *  Display asterisk instead of
 #   "                                │    leading space in a numeric
 L  Display logicals as "T" or "F"    │ .  Specify a decimal point position
 Y  Display logicals as "Y" or "N"    │ ,  Specify a comma position
 Get Picture Functions
 A     C     Allow only alpha characters
 B     N     Display numbers left-justified
 C     N     Display CR after positive numbers
 D     D,N   Display dates in SET DATE format
 E     D,N   Display dates with day and month inverted
             independent of the current DATE SETting,
             numerics with comma and period reverse
 K     All   Delete default text if first key is not a cursor key
 R     C     Insert non-template characters in the display but do not
             save in the Get variable
 S<n>  C     Allows horizontal scrolling within a Get.  <n> is an integer
             that specifies the width of the region
 X     N     Display DB after negative numbers
 Z     N     Display zero as blanks
 (     N     Display negative numbers in parentheses with leading spaces
 )     N     Display negative numbers in parentheses without leading spaces
 !     C     Convert alphabetic character to upper case
 Get Picture Template Symbols
 A    Allow only alphabetic characters
 N    Allow only alphabetic and numeric characters
 X    Allow any character
 9    Allow digits for any data type including sign for numerics
 #    Allow digits, signs and spaces for any data type
 L    Allow only T, F, Y or N
 Y    Allow only Y or N
 !    Convert alphabetic character to upper case
 $    Display a dollar sign in place of a leading space in a numeric
 *    Display an asterisk in place of a leading space in a numeric
 .    Display a decimal point
 ,    Display a comma
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Problem with Tget
Posted: Thu Jul 12, 2018 01:43 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Problem with Tget
Posted: Thu Jul 12, 2018 01:54 PM
Code (fw): Select all Collapse
#Include "Fivewin.ch"

Static ntotale, nSubTotale, nSconto, nAcconto, nDaSaldare, oDlg

FUNCTION Main()

   Local aGet:= Array(10)
   Local oBrowse := nil
   Local oSay[10]

   ntotale    := 0.00
   nSubTotale := 0.00
   nAcconto   := 0.00
   nDaSaldare := 0.00
   nSconto    := 0.00

   DEFINE DIALOG oDlg SIZE 300, 300 PIXEL COLORS CLR_BLACK, CLR_WHITE ;
          TRANSPARENT

   @ 10,5 SAY oSay[5] Prompt "Acconto :" OF oDlg PIXEL SIZE 70,20 ;
          TRANSPARENT UPDATE

   @ 10,75 GET aGet[7] VAR nAcconto SIZE 40,12 PIXEL OF oDlg ;
           PICTURE "@R €99,999.99" UPDATE                    ;
           ON CHANGE( aGet[7]:Assign(), CalcoloTotali( oBrowse, aGet )  )

   @ 40,5 SAY oSay[6] Prompt "Da Saldare :" OF oDlg PIXEL SIZE 70,20 ;
          TRANSPARENT UPDATE

   @ 40,75 GET aGet[8] VAR nDaSaldare SIZE 40,12 PIXEL OF oDlg ;
           PICTURE '@ €99,999.99' UPDATE WHEN( .F. ) // READONLY

   ACTIVATE DIALOG oDLG CENTERED

RETURN NIL

Function CalcoloTotali( oBrowse, aGet )

   Local n

   nTotale:= 0
   nSubtotale:= 0
   nSubTotale:= 18.00    //only for test

   nTotale    := nSubTotale-nSconto
   nDaSaldare := nTotale-nAcconto

   // aGet[7]:refresh()  // acconto ????????

   aGet[8]:refresh()  // da saldare

   * oBrowse:Refresh()
   *  oBrowse:GoBottom()

Return Nil

// FIN
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Tget
Posted: Thu Jul 12, 2018 02:17 PM

THIS WAS THE ERROR
// aGet[7]:refresh()
THANKS

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Problem with Tget
Posted: Thu Jul 12, 2018 02:24 PM

Use HBFORMAT.EXE to indent your code.

C:\XHARBOUR\BIN

18/02/2017 00:12 922.112 hbformat.exe

Example: HBFORMAT SILVIO.PRG

Regards.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Tget
Posted: Fri Jul 13, 2018 08:12 AM
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
:-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-) :-)






It's nice to plan in fivewin ... every day many teachers and professors of the language come out of the loop that you never thought were alive :-)
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion