Jump to content

Is it a Good Idea?: $CmdLineRaw as a Macro


TheDcoder
 Share

Commandline Dilemma  

9 members have voted

  1. 1. What would be best option according to you?

    • Change $CmdLineRaw to @CmdLine and remove $CmdLine array
    • Change $CmdLineRaw to @CmdLine(Raw) and keep $CmdLine array
      0
    • Don't change anything!
    • Other (please specify)


Recommended Posts

Hello! I am back with another IIAGI? (Is it a Good Idea?) :P

 

I think $CmdLineRaw is more like a macro than a "special" variable (which cannot be changed)... So making ti @CmdLineRaw would make more sense and there will 1 less exception to variables :D, I know that you were wondering about the $CmdLine "special" array... I didn't forgot it, but I don't think a macro can be a array, so I just ignored it... Maybe removing the $CmdLine and changing $CmdLineRaw to @CmdLine would be nice if you ask me :).

 

Think before choosing! TD :D

 

P.S Feel free to disagree with me, I want hear your opinion as well :).

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

changing anything in $CmdLine[] & $CmdLineRaw now, will give a whole new meaning to the concept of maintaining backward compatibility ;)

in practice, it is true that AutoIt is somewhat lacking in it's way of handling command line arguments; that's why several users have come up with their own methods and UDF. this is one such example:

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

@orbs Yeah, but the people who want those feature can use older version (like @TheSaint)

@MachinistProgrammer Hmm... a macro array? :think:, While I agree that it will create breaking changes, AutoIt Coder can easily fix the issue by using a simple Replace operation :)

 

TD :D

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

A macro by definition is a quick way of getting some run-time system information which may differ from machine to machine. the command line parameters are not like that they are absolute and provided by the user.

I initially cannot see a reason to have it look like a macro.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

At run-time, you don't know what @sec is, and it changes, well, every second. while command line is still absolute and remains so for the lifetime of your script.

EDIT:

I might be similar to doing this...

Global Const $GCONST = 99.9

$value = 100 / _GetGlobalConst()

Func _GetGlobalConst()
    Return $GCONST
EndFunc

 

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

@JohnOne How do you explain @CRLF then? They remain the same the whole life :P. This Quote is taken from the help file:

...macros are generally used to provide easy access to system information...

As you can see that macros "generally" provide easy access to system... There is no rule that the should only provide "that", viz. the birth of @CRLF :lol:

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Every AutoIt macro is there to save you from writing a bunch of lines yourself to get the correct information, you can list them all one by one if you wish to but it wont change it.

With $CommandLineRaw, you'd be replacing $ with @ and probably making some internal call which is not needed.

I've tried, but still cannot see a single valid reason to have it.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Except a little naivety perhaps .... we all try to lose that.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

  • Developers

A Line Feed or Carriage Return can be different from machine to machine.

Don't think this is 100% correct. I would have said that a "newline" is sometime CRLF and sometimes either LF or CR.
 

On this topic in general: it feels like some people have way too much time on their hands to come up with these kind of proposals and have this lengthy discussion about it.
These design decision where made a long time ago and honestly fail to see the benefit of any change other than when the goal is to confuse people. :)

.Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

some people have way too much time on their hands to come up with these kind of proposals and have this lengthy discussion about it.

:shifty::idea::lmao:o:)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...