Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - __browse_colsep browse column separator http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 __browse_colsep     Browse column separator
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   byte __browse_colsep

 Default
   '|' (chr(179)).

 Description
   The __browse_colsep system variable stores a character code that
   the browse() function assumes as the browse column separator. The
   callback function used in conjunction with the browse() function is
   responsible for painting the record display, optionally utilizing the
   value of __browse_colsep.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   vardef static
      byte bColor3[ 3 ] := CYAN_BLUE, WHITE_WHITE, CYAN_BLUE
   enddef
   
   proc Info3 static
   // Show record information
   savearea( 9, 10, 15, 70 )
   @  9, 10 clear to 15, 70
   @  9, 10 to 15, 70 double
   @ 11, 13 ?? "Record number:", istr( recno() )
   @ 12, 13 ?? "Last name    :", sTest->lastname
   getkey()
   restorearea()
   endproc
   
   func uint BrowseCallback3 static
   param value ulong nAddress, ;
         value uint  uCallType, ;
               char  cRecord
   // Return a record or a key code
   vardef
      uint      uRet
      char( 3 ) cColSep
   enddef
   uRet := BROWSE_NIL
   do case
   case uCallType == 0                                 // return a record
      cColSep := chr( __browse_colsep )
      cRecord := sTest->firstname + cColSep + ;
                 sTest->lastname + cColSep + ;
                 istr( sTest->age ) + cColSep + ;
                 logtostr( sTest->sex ) + cColSep + ;
                 str( sTest->balance, 9, 2 ) + cColSep + ;
                 dtoc( sTest->due ) + cColSep + ;
                 "<memo>"
   case uCallType == 1                                 // process special keys
      do case
      case lastkey() == K_F5               // info
         Info3()
      case lastkey() == K_DEL              // delete/recall
         if deleted()
            recall
         else
            delete
         endif
         uRet := BROWSE_RESTART
      case lastkey() == K_F10              // quit
         uRet := BROWSE_QUIT
      endcase
   endcase
   return( uRet )
   endfunc
   
   proc Test_browse_colsep
   vardef
      char( 74 ) cTitle[ 3 ]
   enddef
   cTitle[ 0 ] := "Sample application"
   cTitle[ 1 ] := replicate( "-", 50 )
   cTitle[ 2 ] := center( "Demonstrate using the browse() function", 50 )
   // __browse_colsep := "|"               // change column separator
   open sTest index sIdxLN
   go top
   browse( sTest, 8, 17, 18, 63, cTitle[], ;
      center( "F5 Info  Del Delete/Recall  F10, Esc Quit", 50 ), ;
      "First      Last name       Ag Sex Balance   Due      Notes", ;
      bColor3[], 1, 1, reccount() + 1, BrowseCallback3 )
   endproc

   proc main
   Test_browse_colsep()
   endproc

See Also: browse()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson