Problem in Tutorial 20

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Problem in Tutorial 20

Post by sudip »

Hello All,

I found problem in \samples\tutorial\tutor20.prg

Code: Select all

tutor20.prg(33) Error E0030  Syntax error "syntax error at '@'"
Today, a new HMG user mailed me about this error. I also tested it.

Is there any solution?
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Problem in Tutorial 20

Post by Rathinagiri »

I think it was created for some previous version(s) of HMG. Kindly use this code.

Code: Select all

#include "hmg.ch"

Function Main

OpenTables()

    DEFINE WINDOW Win_1 ;
        AT 0,0 ;
        WIDTH 640 HEIGHT 480 ;
        TITLE 'Tutor 20: GRID Test' ;
        MAIN NOMAXIMIZE 

        DEFINE MAIN MENU 
            POPUP 'File'
                ITEM 'Set Grid RecNo' ACTION Win_1.Grid_1.Value := Val ( InputBox ('Set Grid RecNo','') )
                ITEM 'Get Grid RecNo' ACTION MsgInfo ( Str ( Win_1.Grid_1.RecNo ) )
                SEPARATOR
                ITEM 'Exit' ACTION Win_1.Release
            END POPUP
            POPUP 'Help'
                ITEM 'About' ACTION MsgInfo ("Tutor 20: GRID Test") 
            END POPUP
        END MENU

        @ 10,10 GRID Grid_1 ;
            WIDTH 610 ;
            HEIGHT 390 ; 
            HEADERS { 'Code' , 'First Name' , 'Last Name', 'Birth Date', 'Married' , 'Biography' } ;
            WIDTHS { 150 , 150 , 150 , 150 , 150 , 150 } ;
            ROWSOURCE "Test" ;
            COLUMNFIELDS { 'Code' , 'First' , 'Last' , 'Birth' , 'Married' , 'Bio' } ;
            columncontrols {{"TEXTBOX","NUMERIC"},{"TEXTBOX","CHARACTER"},{"TEXTBOX","CHARACTER"},{"TEXTBOX","DATE"},{"CHECKBOX"},{"TEXTBOX","CHARACTER"}};
            ALLOWDELETE ;
            EDIT

    END WINDOW
    Win_1.Grid_1.RecNo := RecNo()
    CENTER WINDOW Win_1

    ACTIVATE WINDOW Win_1

Return Nil

Procedure OpenTables()
    Use Test
 
Return Nil
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1456
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Problem in Tutorial 20

Post by sudip »

Thanks a lot Rathi.
COLUMNCONTROLS was missing :)
With best regards,
Sudip
Post Reply