First topic, please help with little project

You can share your experience with HMG. Share with some screenshots/project details so that others will also be benefited.

Moderator: Rathinagiri

User avatar
dragancesu
Posts: 671
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 21 times
Been thanked: 135 times

First topic, please help with little project

Post by dragancesu » Wed Jul 17, 2013 12:04 pm

Hello everyone,
I began to learn HMG, examples work, but when I try to change something it will not work. One little project I downloaded here, I tried to change a little but will not work. I attach it here so who knows he should say what the problem is, no more patience

Thank you for your understanding
Attachments
test1.zip
(5.05 KiB) Downloaded 135 times

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 386 times
Been thanked: 111 times
Contact:

Post by esgici » Wed Jul 17, 2013 12:26 pm

dragancesu wrote:Hello everyone,
I began to learn HMG, examples work, but when I try to change something it will not work. One little project I downloaded here, I tried to change a little but will not work. I attach it here so who knows he should say what the problem is, no more patience
Hi Dragan

You are welcome :)

You need use control names instead of Control.x notation; such as:

Code: Select all

  Win_1.PRIMERO.Enabled	:= .F.
  Win_1.ANTERIOR.Enabled := .F.
  Win_1.SIGUIENTE.Enabled := .F.
  ...
instead of :

Code: Select all

  Win_1.Control_1.Enabled	:= .F.
  Win_1.Control_2.Enabled	:= .F.
  Win_1.Control_3.Enabled	:= .F.
  ...
After that corrections may occurs other problems. This is normal situation at beginning.
Please don't hesitate to asking anything; here you are between firends :)

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Wed Jul 17, 2013 12:28 pm

Hi,

Welcome to HMG Forum.

I have gone through your project.

In the emp.prg, in line 124 you are referring 'Win_1.Control_1.Enabled := .F.'. But control_1 is not at all defined. Only Label_1, Label_2 are defined. This you can see from the Errorlog.html.

Please don't hesitate to ask questions.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Rathinagiri
Posts: 5263
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 169 times
Been thanked: 172 times
Contact:

Post by Rathinagiri » Wed Jul 17, 2013 12:28 pm

:) Thanks Esgici.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
danielmaximiliano
Posts: 2117
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 144 times
Been thanked: 20 times
Contact:

Post by danielmaximiliano » Wed Jul 17, 2013 12:42 pm

Bienvenido / Welcome Dragancesu


-iba a comentar la falta del control Control_1 hasta Control_8 que en su reemplazo agregre Controles etiquetas
y darle las propiedades correctas como ser "numerico", "Date" , Text y la longitudes maximas que soporten.

Translate Google
-going to comment on the lack control_1 to Control_8 until its replacement that controls Label or Textbox
and give the correct properties such as "numeric", "Date", Text and maximum lengths that support.

Code: Select all

*------------------------------------------------------------*
PROCEDURE New()
*------------------------------------------------------------*
  set order to 1
*  set filter to emp->cod_cli#'41118000'
  dBGoBottom ()
  Win_1.Control_1.Value		:= alltrim(str((val(emp->empno)+1)))
  Win_1.Control_2.Value		:= 'Enter NAME'
  Win_1.Control_3.Value		:= 'Enter JOB'
  Win_1.Control_4.Value 	:= 0
  Win_1.Control_5.Value 	:= date()
  Win_1.Control_6.Value 	:= 0
  Win_1.Control_7.Value		:= 0
  Win_1.Control_8.Value		:= 0

  ActivarEdicion()
RETURN
From Buenos Aires / Argentina
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
dragancesu
Posts: 671
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 21 times
Been thanked: 135 times

Post by dragancesu » Wed Jul 17, 2013 2:11 pm

I've seen that error in a line is not something defined, but did not receive a response. Attached is a project that I downloaded and tried to change, but I'm not.
OK, so it is necessary to define what is missing?
This may not be the best way to learn, you have a better way?
Attachments
client.rar
(114.12 KiB) Downloaded 165 times

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 386 times
Been thanked: 111 times
Contact:

Post by esgici » Wed Jul 17, 2013 3:47 pm

dragancesu wrote:I've seen that error in a line is not something defined, but did not receive a response. Attached is a project that I downloaded and tried to change, but I'm not.
OK, so it is necessary to define what is missing?
This may not be the best way to learn, you have a better way?
Dragan,

Your first question and attached sample was a good example of SSW ( Short, simple and working ( until problem point ).

In this way ( sometime referred as KISS ( keep it short and simple ) ) getting a response will be more possible and probable.

But sadly the second is not.

First, you didn't notify us about results of first step; three person answered you, does the suggestions fixed your problem ?

Second, "did not receive a response" clause is not clear enough. What response you was wait and from what ?

Third, without known the result of first question, you are asking a second with a big (not SSW) project. Moreover without knowing what you want to change, how we can know how you can change it ?

For me, only understandable part of your post is the last line :
This may not be the best way to learn, you have a better way?
You are right, this isn't the best way to learn, IMHO in the beginning stage the better way may be :

- KISS always everything. Go through HMG samples, build, run and observe the results on as soon as much samples.
- Begin with simple controls such as button, label and textbox; and than ( after learned enough that simple ones and basic points of HMG ) go to complex ones, such as browse, grid, edit extended ...
- Don't deal big projects; such as converting text mode applications to GUI, and especially such "downloaded" project, that is written by other persons.

And a last point: Here ( HMG Forum ) is international forum and main language of forum is English. Most of us (including me) are not native speakers of English. Please don't speak any other language and please keep your speech simple as soon as possible.

If my words look like "didactic" please don't understand me wrong; my only goal is to help you ( and all who ask help ).

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 386 times
Been thanked: 111 times
Contact:

Post by esgici » Wed Jul 17, 2013 4:05 pm

dragancesu wrote:I've seen that error in a line is not something defined, but did not receive a response...
"Defined and not used" isn't problem; problem is "used and not defined". In your sample "Control_1" ( and other "Control_x"s ) used (referenced) but not defined.

The error message in the ErrorLog.htm file

Contro: Control_1 Of Win_1 Not defined. Program Terminated


indicating this problem.

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D

User avatar
dragancesu
Posts: 671
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 21 times
Been thanked: 135 times

Post by dragancesu » Thu Jul 18, 2013 8:20 am

Solved, see what the problem is, I deleted the part of the program where you define the fields. Beginers mistake

Now I have a problem with date, I've want date format like GERMAN type which should show date in dd.mm.yyyy but not so. Datepicker shows how it wants
How is it defined? Or to make the conversion date-string?

User avatar
mol
Posts: 3195
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 214 times
Been thanked: 120 times
Contact:

Post by mol » Thu Jul 18, 2013 11:49 am

It really looks that DATEPICKER format is YYYY.MM.DD
but TEXTBOX work OK for me and uses SET DATE FORMAT.

Rathi or Claudio should check it.

Post Reply