MAP Function

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
Amarante
Posts: 182
Joined: Fri Apr 27, 2012 9:44 pm
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
Location: Araruama-RJ, Brazil

MAP Function

Post by Amarante »

Excuse my ignorance and my poor english (via google translator), but is there any function in harbour to create empty objects similar to CLIP MAP() function.

Sample in CLIP:
function MyClassNew()
obj:=map() // empty object
clone(MyClass2New(),obj) // adoption of MyClass2 structure
clone(MyClass3New(),obj) // adoption of MyClass3 structure
// if there are coinciding attributes or
// methods, elements of the last class
// become main.
obj:attribute1:=0
obj:attribute2:=date()
obj:method1:=@func1() // method1 becomes a function reference
obj:method2:=@func2()
// these functions must be defined in
// the same .prg file as static
// if methods have been addopted from other classes,
// they will be reassigned to indicated classes
return obj // returning a ready object

static function func1
::attribute1++
return NIL
static function func2(self)
self:attribute1--
return self

See:
http://www.itk.ru/clip-doc.en/leoomodel.html#LEOOINTRO
User avatar
luisvasquezcl
Posts: 1263
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Contact:

Re: MAP Function

Post by luisvasquezcl »

Hola Amarante,
Creo que sería más fácil si nos indicaras que es lo que quieres hacer o cual es la consulta especifica para poder ayudarte.
Yo soy hispano parlante y la verdad es que serìa ùtil si pusieras tambièn el texto en español ya que el traductor de google a veces no es muy exacto. :D
Saludos cordiales,
Luis Vasquez

In english by google translator

Hello Amarante,
I think it would be easier if you will tell us what you want to do or what the query specifies to help.
I am Spanish speaking and the truth is that it would be useful if you put also the Spanish text as google translator sometimes not very accurate. : D
Best regards,
Luis Vasquez
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: MAP Function

Post by danielmaximiliano »

Hello / Hola Amarante :
mire aqui / look here

http://hmgforum.com/viewtopic.php?f=5&t ... aps#p12732
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
Amarante
Posts: 182
Joined: Fri Apr 27, 2012 9:44 pm
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
Location: Araruama-RJ, Brazil

Re: MAP Function

Post by Amarante »

Em Português:
Tentarei ser mais claro.
Para quem não conhece existe uma linguagem no padrao xbase para Linux chamada CLIP veja em http://www.itk.ru
Nela existe uma função chamada MAP que cria objetos (OOP) vazios.
Tenho uma série de fontes criados para CLIP que usam esta função e preciso converter estes fontes para Harbour, no entanto desconheço a existência de uma função semelhante em Harbour.

Español (via google):
Voy a tratar de ser más claro.
Para aquellos que no saben que hay un lenguaje en xbase estándar para Linux llamado CLIP vistazo a http://www.itk.ru
En ella hay una función que crea objetos llamados MAP (OOP) vacía.
Tengo un número de fuentes diseñado para sujetarse utilizando esta función y debe convertir estas fuentes para Harbour, sin embargo desconoce la existencia de una función similar a Harbour.

English (via google):
I will try to be clearer.
For those who do not know there is a language in xbase standard for Linux called CLIP look at http://www.itk.ru
In it there is a function that creates objects called MAP (OOP) empty.
I have a number of sources designed to CLIP using this function and must convert these sources for Harbour, however unaware of the existence of a function similar to Harbour.

(Se alguma Brasileiro quiser traduzir melhor eu agradeço)
dtoledo
Posts: 5
Joined: Thu Jul 22, 2010 2:07 am
Location: Santiago de Chile

Re: MAP Function

Post by dtoledo »

GOOGLE TRANSLATION

Olá, Amarante.

A maneira de criar objetos em (x)Harbour é diferente do que é utilizado no CLIP.
Acho que te seria muito útil conseguir o arquivo de ajuda que vem com harbour que acompanha a distribuição de minigui extended. Está em formato chm na pasta <minigui\\harbour\\doc>


Com respeito a :

Code: Select all

// if there are coinciding attributes or
// methods, elements of the last class
// become main.
Acredito que terias que provar como funciona, mas me parece que se ajusta ao que buscas.

Acho que o que você quer é alguma coisa com o seguinte código (NO TESTADO!).

Code: Select all

#include "hbclasss.ch"

CLASS MyClassNew2()
  DATA Attribute1
END CLASS

CLASS MyClassNew3()
  DATA Attribute2
END CLASS

CLASS MyClassNew() FROM MyClass2New, MyClassNew3

DATA MyAttribute INIT 0
DATA OtherAttribute INIT NIL

METHOD NEW()
METHOD func1()
METHOD func2(prm)

END CLASS

METHOD New() CLASS MyClassNew
  ::attribute1:=0
  ::attribute2:=date()
RETURN Self // this return 

METHOD func1 CLASS MyClassNew
  ::attribute1++
RETURN NIl

METHOD func2(prm)
  prm:attribute1--
return prm

Saludos desde Santiago de Chile

Dago
User avatar
Amarante
Posts: 182
Joined: Fri Apr 27, 2012 9:44 pm
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
Location: Araruama-RJ, Brazil

Re: MAP Function

Post by Amarante »

Dtoledo,
Eu conheço a estrutura de objetos que é usada em HMG, o que eu queria era diminuir meu trabalho, mas vou tentar adaptar. :|
Obrigado pela atenção. :D
Daniel Amarante
Post Reply