Modules in HMG 3.1.1
Posted: Sun Jul 21, 2013 6:27 am
Hello everybody,
I have a simple question. I wish to make more modules for my functions and procedures, but I have the folowing problem:
I made a module "buttonactions.prg" for functions evaluating the click event on the commandbuttons.
The content of buttonactions.prg:
#include <hmg.ch>
function clickintrari
main.image_1.picture:="butoane\intrariactiv.bmp"
return
This function is called by an action event by clicking on an image (used as commandbutton).
The form is named "MAIN" (main.fmg)
In action event of an image I just typed: "clickintrari()"
If I put this funtion in "main.prg" everything runs well, but if I place it in "buttonactions.prg", on compile, I have an error message, error on line 4, Error E0030 Sintax error at '.'
In "buttonaction" module I can't refer to the object "main"
By example is also not working: main.title:="Test"
Why this happens? What I have to do to can manage my functions in modules? Why I cannot refer from a module to an object if I specify the parent name?
Best regards,
Zoli B.
I have a simple question. I wish to make more modules for my functions and procedures, but I have the folowing problem:
I made a module "buttonactions.prg" for functions evaluating the click event on the commandbuttons.
The content of buttonactions.prg:
#include <hmg.ch>
function clickintrari
main.image_1.picture:="butoane\intrariactiv.bmp"
return
This function is called by an action event by clicking on an image (used as commandbutton).
The form is named "MAIN" (main.fmg)
In action event of an image I just typed: "clickintrari()"
If I put this funtion in "main.prg" everything runs well, but if I place it in "buttonactions.prg", on compile, I have an error message, error on line 4, Error E0030 Sintax error at '.'
In "buttonaction" module I can't refer to the object "main"
By example is also not working: main.title:="Test"
Why this happens? What I have to do to can manage my functions in modules? Why I cannot refer from a module to an object if I specify the parent name?
Best regards,
Zoli B.