whats wrong in program?

Other General Resources like icon sets, sound files etc.,

Moderator: Rathinagiri

Post Reply
User avatar
dragancesu
Posts: 477
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 3 times
Been thanked: 73 times

whats wrong in program?

Post by dragancesu » Fri Jun 05, 2015 1:22 pm

I'm trying to make a tool that we facilitate programming now trying to present what will be on the screen

The question is why a program error occurs on line 69?

Green fields are label and there need display L_Name
Orange fields are fields and there need display F_Name
Attachments
wrong.zip
(1.37 KiB) Downloaded 59 times

User avatar
gfilatov
Posts: 519
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Has thanked: 8 times
Been thanked: 72 times
Contact:

Post by gfilatov » Fri Jun 05, 2015 2:29 pm

Hi Dragan,

Try

Code: Select all

...
   _labx = 'label' + hb_ntos(_GetId())
   _labv = l_name   
   
   // labels 

   //altd()   
   
   @ _rowl, _coll LABEL &(_labx) VALUE _labv OF FromTest
...   
Hope that helps :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein

User avatar
dragancesu
Posts: 477
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 3 times
Been thanked: 73 times

Post by dragancesu » Fri Jun 05, 2015 3:16 pm

Yes, it's help

Solve is

Code: Select all

#include <hmg.ch>
*:*****************************************************
FUNCTION main //       fm_test 

DEFINE WINDOW FromTest ;
		AT 10,10 ;
		WIDTH 800 ;  
		HEIGHT 800 ;
        TITLE 'Preview Form' ;
		MAIN ; // MODAL
		
      ON KEY ESCAPE ACTION FromTest.Release

      @ 700, 700 LABEL label1x ;  // << label1 is  duplcate name
         VALUE " LEGEND "
   
      @ 720, 700 LABEL label2x ; // << label2 is  duplcate name
         VALUE " GRID "
      
      @ 735, 700 LABEL label3x ; // << label3 is  duplcate name
         VALUE " LABEL "
         
      @ 750, 700 LABEL label4x ; // << label4 is  duplcate name
         VALUE " FIELD "
         
	END WINDOW		 

   fmTest()
   
	CENTER WINDOW   FromTest
	ACTIVATE WINDOW FromTest
   
Return
*:******************************************************
function fmTest

// make line
 
DRAW LINE IN WINDOW FromTest AT 710,5 TO 710,795

// show legenda

DRAW RECTANGLE IN WINDOW FromTest AT 720,680 TO 730,690 pencolor { 128,128,255 } FILLCOLOR { 128,128,255 }
DRAW RECTANGLE IN WINDOW FromTest AT 735,680 TO 745,690 pencolor { 55,201,48 } FILLCOLOR { 55,201,48 }
DRAW RECTANGLE IN WINDOW FromTest AT 750,680 TO 760,690 pencolor { 255,102,10 } FILLCOLOR { 255,102,10 }

// show grid

DRAW RECTANGLE IN WINDOW FromTest AT 90,10 TO 390,710 pencolor { 128,128,255 } FILLCOLOR { 128,128,255 }

use _my_frm

dbgotop()
do while .not. eof()

   _row1 = f_row
   _col1 = f_col
   _row2 = f_row + 20
   _col2 = f_col + f_width
   _rowl = f_row + l_row
   _coll = f_col + l_col
   _labx = 'label' + alltrim(str(recno()))
   _labxx = 'label' + alltrim(str(recno()+100))
   _labv = l_name   
   _labf = f_name
   
   // labels 

   if !empty(L_name)
      DRAW RECTANGLE IN WINDOW FromTest AT _rowl, _coll TO _rowl+15, _coll+50 pencolor { 55,201,48 } FILLCOLOR { 55,201,48 } 
      @ _rowl, _coll LABEL &(_labx) VALUE _labv OF FromTest transparent           // << tranparent if you want see rectangle
   endif
         
   // fields
   
   DRAW RECTANGLE IN WINDOW FromTest AT _row1, _col1 TO _row2, _col2 pencolor { 255,102,10 } FILLCOLOR { 255,102,10 }
    @ _row1, _col1 LABEL &(_labxx) VALUE _labf OF FromTest transparent          // << tranparent if you want see rectangle
      
   dbskip()
enddo

RETURN 0
Thank you

Post Reply