Jump to content

Recommended Posts

Posted

Hi ppl :bye:

Sometimes I wish I could use several commands in one line :rambo:

My suggestion is (in the next language revision) to use the "line continuation" symbol '_' to permit "one liners" :graduated:

Something like

ConsoleWrite( x ) _ func1( x ) _ ConsoleWrite( x ) _ func2( x) _ ConsoleWrite( x ) :gathering:

for the "oldies"... something "á la Clipper" :alien:

I think it's useful :sorcerer:

for the Interpreter token evaluator : o:)

1. (space)+'_'+(CRLF) ---> is the line continuation

2. (space)+'_'+(space) ---> is the line separation

Posted
  On 4/23/2013 at 1:13 PM, 'ZeeXEez said:

Sometimes I wish I could use several commands in one line

You can't have multiple commands in a single line with AutoIt. Full stop.

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

ZeeXEez,

I (and others) can see how this would enhance the language. Care to explain further?

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • Moderators
Posted (edited)

  On 4/23/2013 at 2:26 PM, 'guinness said:

Care to explain further?

And :sorcerer: Be sure :zorro: to include plenty of these guys :x for JohnOne's amusement :)

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

  On 4/23/2013 at 2:26 PM, 'guinness said:

I (and others) can see how this would enhance the language. Care to explain further?

I do not fit into the category of 'others' :x

:zorro: doesn't either. he thinks that the current syntax is :thumbsup: and that those who oppose :zorro: is a butt :pirate:

  Reveal hidden contents

 

Posted

You already do this with operators, but you do not get the error checking. Have a look a this example.

Global $x = 1

Global $iResult = ConsoleWrite($x & @CRLF) + ConsoleWrite(func1($x) & @CRLF) + ConsoleWrite(func2($x) & @CRLF)

Func func1($y)
    Return $y + 1
EndFunc

Func func2($y)
    Return $y + 2
EndFunc
Posted

^^^ I guess that's one way to skin a cat...

  Reveal hidden contents

 

Posted

Having multiple commands on the same line does nothing except make the length of the code in the editor shorter in 'height", but longer in line length. It also makes it a nightmare to troubleshoot if there's ever a problem with the code. Not to mention, it's tough to follow the code when you stuff it all on a line like that.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

Very true, BrewManNH. I just wanted to show that this feature was available already in some form. Even when something is possible, doesn't always mean that it should be done.

Posted

I meant I can't see a use, not can. Dumb me!

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

I like to keep my code compact in certain situations... this can be done in C, C++, C#, Java, Javascript, etc.

I think It's one more tool in the bag, and I'm certain after some examples lot's of people will start to use it

As of lexicon and code interpreter doesn't seem to be difficult with the rules I've pointed before...

(look dude,,, no <EmOtIcOnS> ---> = NO FUN... next message I'll use them again!!! lOl)

Posted

It doesn't make your code compact though, it just makes it harder to read and follow. It still takes up the same amount of characters, minus the CRLFs. As stated before, just because you CAN do something (in another language) doesn't mean it's a good idea. Most people would frown upon any code written like that, in any language.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

Do people actually use this in production code i.e. C++ source code? Can't say I have come across it.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

  On 4/24/2013 at 6:10 AM, 'guinness said:

Do people actually use this in production code i.e. C++ source code? Can't say I have come across it.

Some do. It's not unusual to find sequences of closely related function calls put in one line. For example:

//...
std::printf("...\n"); std::fflush(stdout);
//...

...that line would obviously print some text. Lazy people.

♡♡♡

.

eMyvnE

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...