Format() - TimeStamp functionality

Propose new features and changes
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Format() - TimeStamp functionality

05 May 2017, 16:07

It would be kind of cool if we could reformat TimeStamps using the Format function.
So far Format() has replaced all the reformating functionality of SetFormat.
I think it would be nice to additionally replace all the functionality of FormatTime - and having a single unified way to display all the datatypes in AutoHotkey.
Recommends AHK Studio
lexikos
Posts: 9560
Joined: 30 Sep 2013, 04:07
Contact:

Re: Format() - TimeStamp functionality

05 May 2017, 22:18

How much thought did you put into this? Since you didn't suggest any particular syntax, I'd guess not much.

I have considered it before and concluded that there is no good way to integrate the formatting capabilities of FormatTime with Format. They can easily be used in combination as they are.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Format() - TimeStamp functionality

06 May 2017, 03:52

This is indeed a problem. Yet it would be really nice. I'll see if I can find something.
Recommends AHK Studio
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Format() - TimeStamp functionality

10 May 2017, 04:49

Well the general issue is that Format assumes that any type it works with supports the format specifiers you defined.
However time doesn't do that and it needs it's own specific options.

The way Format is now it might not be easy to extend further down in the development, though that might not be neccessary for anything else other than adding time functionality.

A better way of handling Format could be putting the type first and then add flags and specifiers in brackets behind them:

Code: Select all

Format( "{:Type( Flags Width .Precision ULT )}" ) ;For current types ( could also be more specific ( like ULT only being important for string types )  )
Format( "{:timeType( Format )}" ) ;For time types
However we currently do not use that syntax and since any changes to the command need to be backwards compatible to make a difference for v1.
That leaves us with several options:
  1. Just drop the time ( and possibly any other change that might come after it ) and leave the current syntax
  2. Create exceptional syntax by creating an exception for a specific syntax that does not interfere with the old syntax
  3. Move this wish to v2 ( possibly even further delaying v2 ) and remove the old syntax
Recommends AHK Studio
guest3456
Posts: 3454
Joined: 09 Oct 2013, 10:31

Re: Format() - TimeStamp functionality

10 May 2017, 08:08

option 4: do nothing and continue using FormatTime

User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Format() - TimeStamp functionality

10 May 2017, 08:28

Reread option 1.
Recommends AHK Studio
joefiesta
Posts: 494
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: Format() - TimeStamp functionality

08 Sep 2017, 10:51

I'd vote against this in an instance. Basically, I find the syntax of the Format function so completely complicated that I stay away from unless completely necessary. The last thing it needs for embellishment.

Joe Petree
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Format() - TimeStamp functionality

08 Sep 2017, 20:24

The Format function can be really useful:

Code: Select all

q::
oArray := [300,300,300,300]
MsgBox, % Format("x{} y{} w{} h{}", oArray*)
MsgBox, % Format("{:s} {:i} {:08} {:0.8f}", oArray*)
MsgBox, % Format("{:X} {:x} {:#X} {:#x}", oArray*)
MsgBox, % Format("{:08X} {:08x} {:#010X} {:#010x}", oArray*)
return
[EDIT:] I have some good examples for Format here:
jeeswg's characters tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=26486
Last edited by jeeswg on 10 Sep 2017, 10:15, edited 1 time in total.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
joefiesta
Posts: 494
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: Format() - TimeStamp functionality

10 Sep 2017, 10:06

I will not argue your point, Jeeswg. In fact, I will whole-heartedly agree that the FORMAT function can be EXTREMELY useful as well as EXTREMELY powerful. My problem with format is the documentation. I find it's documentation to be EXTREMELY lacking. It either needs much more thorough explanation of the parameters or a whole slew of examples. As a former IBM mainframe systems programmer, I was totally spoiled by IBM's mainframe documentation. It is pure perfection and surely, I hope, still is. If I wrote them and told them a period was missing somewhere, they fixed it. Sometime ago, I mentioned something somewhere on the old forum about helping with AHK's documentation. I was insulted by the response. I believe the attitude was expressed that either "we don't want your help", or "it doesn't need work". Even today, that attitude is stilll extant IN A SENSE. I say this for two reasons:

1. Trying to find the place in the forum where one can point out documentation issues is an extremely difficult task. The topic, https://autohotkey.com/boards/viewtopic ... &start=220, is buried in the WISH LIST subforum. To start, one should not have to WISH the documentation is corrected if it is incorrect. One can wish, however, it is improved if it is in such need. I would very much like to see a separate forum just for documentation. This would also mean that documentation issues can each be addressed in its own place. Some require no response or discussion. Some do. Intermingling discussions with suggestions is sloppy and difficult to wade through.

2. The huge number of entries in the AHK forums for people constantly asking for help with, in many case, the same problems over and over and over again indicates either (1) they don't read the documentation or (2) the documentation is lacking in detail. We both know number (1) includes a lot of people, but, then again, it's almost impossible to use AHK without reading some documentation. It's number (2) that is the problem.

a. It's plain and simple that the documentation lacks detail in many places. Please, don't get me wrong. AHK documentation is extremely good when it comes to quantity. It also is very disorganized in many places. Yes, this is no easy fix. And, it is very inconsistent in terms of style in many places. (This last item is an entire other discussion, for some other time.)

b. Too much information can only be garnered by examining examples. Personally, I believe good documentation should NEVER require examples. IBM has NO examples in their REFERENCE level documentation. They reserve examples for USER GUIDES and such. Of course, AHK's documentationn is a blend of these two types. Nevertheless, it would be nice if I NEVER had to read an example to get the full understanding of a command, function or concept. (Yes, too many people want to just cut and paste an example and end up not learning anything.)

c. When a forum question is answered, very few responses address the issue that the documentation--or lack thereof--was the problem (when it really was).

1) Many, many responses suggest just using another method to accomplish a goal instead of pointing out WHY what someone was trying wasn't working.

2) I almost never see the problem being sited as "the documentation should have included ...." or something.

All that--and that's enough for now, surely--being said, since you Jeeswg seem to HAVE concern about things, has the documentation issue attitude changed? Can I help with documentation? I remember reading something, somewhere, about GITHUB and documentation. But thought to myself : At 66, I don't want to learn another piece of software (github)? Maybe github is a piece of cake. But, I think a good start would be making Documentation a forum topic and going from there.

Sincerely,

Joe Petree

p.s. I hope it goes without saying--since I spent so much time writing so much--that I do respect and love AHK.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Format() - TimeStamp functionality

10 Sep 2017, 10:40

I've added a link to some Format examples above.

Wow, a better documentation than AutoHotkey? I think AutoHotkey's is one of the best documentations I've seen.

I think the AutoHotkey documentation is very good, my main recommendations would be:
- the use of '[' and ']' for optional parameters can be confusing, but this can be fixed by examples with/without the optional parameters, I'm not sure if it's clearly stated somewhere that that's what the square brackets mean
- more examples, is often the best solution (I find this true of IT, maths, anything), that way if the explanations are lacking, you still find something that works, and from inspecting the examples, you can work out what's going on, also, if the language barrier is the problem, this makes explanations less useful and examples more useful
- chicken and the egg, sometimes the documentation is so bad, that people don't realise how bad it is, if they understood the topic better, they'd realise how bad that part of the documentation is, where are all the new users complaining about part of the documentation, nowhere, they already gave up on trying to read it
- objects can be hard, and the information is in many different places, I'm not sure that there is an obvious 'objects page 1', but the main solution though, to improve the objects documentation, is more examples, nothing more than that
- I write various tutorials (I have about a dozen on the way)
- I collected everything that I think the documentation should cover (or emphasise) but doesn't (currently):
jeeswg's documentation extension tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=33596
- with perhaps literally one or two exceptions, everything is usually there in the documentation, although 'hidden' sometimes
- in trying to understand objects, when I first obtained a complete list of ComObjXXX and ObjXXX functions, this was the key first step, that led me to finally unravel all the issues to do with objects, but I was told by someone, something like: this is not the way to introduce objects and that it wouldn't work for anybody else
- I believe in explicitly listing all the functions somewhere, I've tried to do this myself,
list of every command/function/variable from across all versions - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=27321
in AHK v2 I've, in the last one or two days, discovered accidentally that there are ListView and TreeView functions for the AHK v2 GUI, not the first time I've discovered some functions accidentally, with functions named in a way that corresponds to object methods, i.e. your can work out the pattern for yourself, but that aren't explicitly listed, similarly the ObjXXX functions were/are not listed explicitly anywhere
- it's difficult but important to put yourself in the mind of a newb, every once in a while I introduce someone to AutoHotkey
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
joefiesta
Posts: 494
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: Format() - TimeStamp functionality

12 Sep 2017, 13:32

I'm working on a reply, Jeeswg. But, in the meantime I realized you did not address two of my most important points.

I said:
Sometime ago, I mentioned something somewhere on the old forum about helping with AHK's documentation. I was insulted by the response. I believe the attitude was expressed that either "we don't want your help", or "it doesn't need work". Even today, that attitude is stilll extant IN A SENSE.
and
has the documentation issue attitude changed? Can I help with documentation?
Can you answer these two questions or am I opening a can of worms?
Joe P.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Format() - TimeStamp functionality

12 Sep 2017, 14:07

The thing is that I, generally speaking, feel that the documentation needs zero changes.

I would want the following:
- a separate index page that lists literally every function(/command/variable/directive/control flow statement) (the index *almost* does this), perhaps with a parameter type summary (e.g. normal v. ByRef parameters, so SplitPath might be NBBBBB), perhaps with a parameter list (I've tried to do some of this myself)
- a page that lists all the pages that are not command/function pages, so a general index, perhaps also a clearly designed AHK and objects 'front page' (you can use 7-Zip to split the chm into separate htm files which achieves the same)
- every so often, to add more examples to the bottom of pages, e.g. if there's an obvious typical problem, not yet addressed by an example, that's a good candidate, also functions that are used commonly, are good candidates
[I'll add all the links that I've just mentioned to my documentation extension tutorial.]

I can't really speak 'for AutoHotkey', I'm just one user, who still hasn't completed one year on the forum. (Actually I did join the old forum at some point, though didn't post, I was about to but then it went into archive state.)
- But then again, the forum is just individuals, so someone has to do the work. I wouldn't hesitate to do what was needed to improve the documentation, but sometimes changes won't necessarily fix anything. If someone comes along wanting to do an overhaul of the documentation, I bet it will be worse than it is now, think Excel 2007 and the Ribbon disaster. Anyhow, I think it's fundamentally right as it is now.
- Everyone has a different idea of what the documentation or AutoHotkey itself should contain, I don't mind if there's some reluctance or intransigence to anything I suggest.
- If I had five things I wanted to change about the documentation and they didn't get changed, so what. If I had a lot of things, I could collect them in a handy post, so that anybody that was interested could incorporate the changes at their leisure, or gain from what I wrote, which is what I did. [My documentation extension tutorial.]

It would be interesting to find that page you mention. A Google search for 'AutoHotkey joefiesta', there aren't too many results, so you might well be able to find the page again. Possibly add some key word, or the name of another user on that thread. Cheers.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
joefiesta
Posts: 494
Joined: 24 Jan 2016, 13:54
Location: Pa., USA

Re: Format() - TimeStamp functionality

13 Sep 2017, 12:03

Thanks, Jeeswg

Gee, you wrote so much and so enthusiastically I thought you were involved in the development of AHK. I haven't found the comment I was given about doc. But, to prove my point: nobody really cares. I mentioned a tiny DOC flaw, in 2010. If every tiny flaw was corrected, the doc would be better. I did work and pointed out the flaw. It would have taken someone 5 minutes to fix it.

Here:
https://autohotkey.com/board/topic/2667 ... ntry379031
I mentioned a flaw in the table of contents AT THE GUI command. It says "Minimize / maximize / restore". It should include "Hide". Nobody cared.

Joe P

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 10 guests