Jump to content
Sign in to follow this  
maqleod

printf()?

Recommended Posts

maqleod

I can't seem to locate any equivalent to printf() in the help file, is there one?

I only see functions to input to a command line app or read from one, but not to act as one.


[u]You can download my projects at:[/u] Pulsar Software

Share this post


Link to post
Share on other sites
AlmarM

I dont know anything about C/C++, but do you mean the magic

MsgBox()

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
maqleod

I dont know anything about C/C++, but do you mean the magic

CODE: AutoItMsgBox()

AlmarM

not quite, I don't want anything but a command prompt, I want all error messages to show up there.

ConsoleWrite() will work and when you need it as CLI then compile it with the right option in aut2exe.

Jos

hmm, missed that one somehow, thanks


[u]You can download my projects at:[/u] Pulsar Software

Share this post


Link to post
Share on other sites
Richard Robertson

ConsoleWrite doesn't perform any formatting though so you'll have to create your own string.

Share this post


Link to post
Share on other sites
maqleod

ConsoleWrite doesn't perform any formatting though so you'll have to create your own string.

true, but what I was most concerned with was getting feedback to any commands to show up in the prompt, formatting the string is easy.


[u]You can download my projects at:[/u] Pulsar Software

Share this post


Link to post
Share on other sites
Richard Robertson

Ok. Just thought I'd mention it.

Share this post


Link to post
Share on other sites
Skrip

AutoIt does not really associate with the command prompt. You are out of luck for this. ConsoleWrite() will be the closest...


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Jos

AutoIt does not really associate with the command prompt. You are out of luck for this. ConsoleWrite() will be the closest...

I don't understand this remark.. care to explain?

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

Share this post


Link to post
Share on other sites
ProgAndy

If you want output on the commandline, you should

a) 1) install the full Scite4AutoIt package ( if you have not already )

....2) insert #AutoIt3Wrapper_Change2CUI=y

....3) compile ( CUI must be compiled first )

b ) OR: use AutToExe and check the Commandline checkbox :mellow:

To format text, just use --> ConsoleWrite(StringFormat(...))

///Edit: you have a third option (if you want console prompt, too and not just CMDLine params): My COnsole UDF: http://www.autoit.de/index.php?page=Thread...44881#post44881

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
trancexx

Just for the record:

$formated_string = StringFormat('Line one\n\t\tLine two\n')

DllCall("msvcrt.dll", "int:cdecl", "printf", "str", $formated_string)

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites
PsaltyDS

Just for the record:

$formated_string = StringFormat('Line one\n\t\tLine two\n')

DllCall("msvcrt.dll", "int:cdecl", "printf", "str", $formated_string)
Still requires the CUI compile option to write to the shell console (as opposed to the SciTE console):
#AutoIt3Wrapper_Change2CUI=y

$formated_string = StringFormat('Line one\n\tLine two\n\t\tLine three\n')

DllCall("msvcrt.dll", "int:cdecl", "printf", "str", $formated_string)

And if you provide that compile option, the DLL call is not requiered:

#AutoIt3Wrapper_Change2CUI=y

$formated_string = StringFormat('Line one\n\tLine two\n\t\tLine three\n')

ConsoleWrite($formated_string)

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
trancexx

As alternative I meant, Master Yoda.


♡♡♡

.

eMyvnE

Share this post


Link to post
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
Sign in to follow this  

×