Hello guys!
The following structure could achieve what way?
myCar = new Object()
myCar.make = "Ford"
myCar.model = "Mustang"
myCar.year = 1969
MsgInfo( 'My Car: ' + myCar.make +' '+ myCar.model )
Best regards, Zoltan
HMG Create object
Moderator: Rathinagiri
- miszler.zoltan
- Posts: 22
- Joined: Sun May 26, 2013 12:37 pm
- Location: Hungary
- Contact:
- mustafa
- Posts: 1159
- Joined: Fri Mar 20, 2009 11:38 am
- DBs Used: DBF
- Location: Alicante - Spain
- Contact:
Re: HMG Create object
Code: Select all
#include "hmg.ch"
Function Main()
myCar_make = " Ford "
myCar_model = " Mustang"
myCar_year = " 1969"
MsgInfo( 'My Car: ' + myCar_make + myCar_model + myCar_year )
Return
Have if you can serve
Mustafa
- miszler.zoltan
- Posts: 22
- Joined: Sun May 26, 2013 12:37 pm
- Location: Hungary
- Contact:
Re: HMG Create object
Hello Mustafa!
Not variables, or array, but I object to solve ...
Not variables, or array, but I object to solve ...
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: HMG Create object
Hi,
you can do the following:
#include "hbclass.ch"
#include "hmg.ch"
proc main
local Mycar := Car()
myCar:make = " Ford "
myCar:model = " Mustang"
myCar:year = " 1969"
MsgInfo( 'My Car: ' + myCar:make + myCar:model + myCar:year )
return
class car
data make, model, year
end class
i hope it will be helpful
Best regards
Luis Vasquez
you can do the following:
#include "hbclass.ch"
#include "hmg.ch"
proc main
local Mycar := Car()
myCar:make = " Ford "
myCar:model = " Mustang"
myCar:year = " 1969"
MsgInfo( 'My Car: ' + myCar:make + myCar:model + myCar:year )
return
class car
data make, model, year
end class
i hope it will be helpful
Best regards
Luis Vasquez
- luisvasquezcl
- Posts: 1258
- Joined: Thu Jul 31, 2008 3:23 am
- Location: Chile
- Contact:
Re: HMG Create object
They can initiate variables with values as follows:
CLASS Car
DATA Make AS CHARACTER INIT ""
DATA Model AS CHARACTER INIT ""
DATA Year AS CHARACTER INIT ""
END CLASS
CLASS Car
DATA Make AS CHARACTER INIT ""
DATA Model AS CHARACTER INIT ""
DATA Year AS CHARACTER INIT ""
END CLASS
- Amarante
- Posts: 182
- Joined: Fri Apr 27, 2012 9:44 pm
- DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
- Location: Araruama-RJ, Brazil
Re: HMG Create object
Hi Zoltan,
There you will find an example I made using objects as well as SQL.
http://hmgforum.com/viewtopic.php?f=37&t=4293#p40736
I hope you find it useful.
Regards
Amarante
There you will find an example I made using objects as well as SQL.
http://hmgforum.com/viewtopic.php?f=37&t=4293#p40736
I hope you find it useful.
Regards
Amarante
- miszler.zoltan
- Posts: 22
- Joined: Sun May 26, 2013 12:37 pm
- Location: Hungary
- Contact:
Re: HMG Create object
Gentlemen!
Thanks to the joint thinking and answers!
Thanks to the joint thinking and answers!