Check for valid

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

User avatar
apais
Posts: 257
Joined: Fri Aug 01, 2008 6:03 pm
Location: uruguay
Has thanked: 23 times
Been thanked: 15 times
Contact:

Re: Check for valid

Post by apais » Thu Sep 14, 2017 11:13 am

on release

ROBROS
Posts: 61
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Has thanked: 32 times
Been thanked: 1 time

Post by ROBROS » Thu Sep 14, 2017 4:26 pm

apais wrote:
Thu Sep 14, 2017 11:13 am
on release
Sorry,I don't know what you mean :?:
On release of what?

Robert

User avatar
apais
Posts: 257
Joined: Fri Aug 01, 2008 6:03 pm
Location: uruguay
Has thanked: 23 times
Been thanked: 15 times
Contact:

Post by apais » Thu Sep 14, 2017 6:28 pm

every window has an on release event

ROBROS
Posts: 61
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Has thanked: 32 times
Been thanked: 1 time

Post by ROBROS » Thu Sep 14, 2017 6:59 pm

ok,so I have to add the on release event to the define window statement?
Sorry hmg (gui) is so different to dbase for DOS.

User avatar
apais
Posts: 257
Joined: Fri Aug 01, 2008 6:03 pm
Location: uruguay
Has thanked: 23 times
Been thanked: 15 times
Contact:

Post by apais » Fri Sep 15, 2017 11:55 am

I'm tryng to say that on realease is a good place to make overall form valiation.

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

Post by Rathinagiri » Fri Sep 15, 2017 2:06 pm

This is what I usually do. When we want a data entry form, I have two buttons viz., 'Save' and 'Cancel'. Standard shortcut keys like Ctrl+S and Escape can also be linked to call these action functions. If an user closes the window without pressing 'Save' that means 'Cancel' or pressing Escape.

Now, whatever be the data required in the form, the user is allowed to enter, navigate through the controls by keyboard or mouse. When he presses the 'Save' button or Ctrl+S, validation of all the controls are checked once and if all of them are 'OK', then the whole data set would be used/saved.

Suppose some fields are interdependent, say only after selecting the item they can enter quantity, there we can use onlostfocus. However, I don't use msginfo() or msgstop(). Instead I would use the status bar or a separate label with red color. This label can be made visible whenever required. By this way the whole focus of the window will not be lost anytime.
screenshot.jpg
screenshot.jpg (78.44 KiB) Viewed 244 times
This is a typical data entry screen of a live application.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

ROBROS
Posts: 61
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Has thanked: 32 times
Been thanked: 1 time

Post by ROBROS » Fri Sep 15, 2017 4:00 pm

@rathinagiri,@apais:
your advice is appreciated, every question I asked and so far every question was answered, brought me forward.

@rathinagiri: I'm surprised that you use the german date format, India was longtime under British rule.

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

Post by Rathinagiri » Fri Sep 15, 2017 6:15 pm

Ya. It is either dd/mm/yyyy or dd-mm-yyyy as you see it. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

ROBROS
Posts: 61
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Has thanked: 32 times
Been thanked: 1 time

Post by ROBROS » Thu Sep 28, 2017 8:08 am

In the first post of this thread you find the source code of defining a window Form_1.
To keep my growing app more readable I wanted to define this window in a separate prg-file, of course without function main.

I removed ';' from line TITLE "Year/Month" ;
and removed 'MAIN' of window definition.

The compiler gives me a 'syntax error' at line TITLE 'Year/Month (without semicolon)

What is going wrong?

User avatar
serge_girard
Posts: 1865
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 292 times
Been thanked: 67 times
Contact:

Post by serge_girard » Thu Sep 28, 2017 9:16 am

Hi Robert,

Do you want to change the title of the main form afterwards? In that case use: Form_name.TITLE := 'something'
In the main DEFINE WINDOW set title to "" (no title)

Not sure if this is what you want...

Serge

Post Reply