07-10-2010, 08:54 PM
Josh,
It takes a lot of time and practice to write a function that is clear and versatile enough to boil it down into one line. I've been working with QM for the last couple of years and I'm only just starting to get the hang of writing a function that can be used for a variety of tasks. Usually I just whip something up to get a job done in the heat of a moment.
Gintaras does a wonderful job writing complicated functions that are extremely well documented and boiled down. I'm sure he will appreciate any ideas to help him in his overwhelming task.
Things I think could help:
Perhaps something like command line switches used in DOS would be useful. The biggest trouble that I have is that some functions in order to be versatile in one line have a lot of variables that they are really complicated to keep track of when programming.
For example, instead of using (I just use the ShowDialog because it has a lot of options):
ShowDialog([$macro] [dlgproc] [!*controls] [hwndowner] [flags] [style] [notstyle] [param] [x] [y] [$icon] [$menu])
If you wanted to set the X and Y you'd have to write out either "" or 0 for the fields you do not wish to use.
if(!ShowDialog("Dialog" &Dialog 0 0 0 0 0 0 100 100))
It'd be easier to just go ShowDialog("Dialog" /X 100 /Y 100)
It takes a lot of time and practice to write a function that is clear and versatile enough to boil it down into one line. I've been working with QM for the last couple of years and I'm only just starting to get the hang of writing a function that can be used for a variety of tasks. Usually I just whip something up to get a job done in the heat of a moment.
Gintaras does a wonderful job writing complicated functions that are extremely well documented and boiled down. I'm sure he will appreciate any ideas to help him in his overwhelming task.
Things I think could help:
Perhaps something like command line switches used in DOS would be useful. The biggest trouble that I have is that some functions in order to be versatile in one line have a lot of variables that they are really complicated to keep track of when programming.
For example, instead of using (I just use the ShowDialog because it has a lot of options):
ShowDialog([$macro] [dlgproc] [!*controls] [hwndowner] [flags] [style] [notstyle] [param] [x] [y] [$icon] [$menu])
If you wanted to set the X and Y you'd have to write out either "" or 0 for the fields you do not wish to use.
if(!ShowDialog("Dialog" &Dialog 0 0 0 0 0 0 100 100))
It'd be easier to just go ShowDialog("Dialog" /X 100 /Y 100)
