Sign in to follow this  
Followers 0
Hellfire

Which Way Is Better

5 posts in this topic

$text = "hi"
Msgbox(0,"",$text)

or

Msgbox(0,"","hi")

Which way is better?

Share this post


Link to post
Share on other sites



it really depends upon your needs...

you could use a variable because you want to use the same meesage box for different messages

otherwise, might as well make it "1" line

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

it really depends upon your needs...

you could use a variable because you want to use the same meesage box for different messages

otherwise, might as well make it "1" line

8)

HI,

I would do in one line, but when you use the variable more than once it makes sense doing it that way, beacuse if the text changes, you can do it on one place.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

as you get more experience, you will likely start writing a collection of UDFs that mirror the way you think and the things you want msgbox() to do for you often -- such that you will rarely, if ever, call MsgBox() directly. For example, an Error Routine might look like the following...

Func _FatalError($Title ="Fatal Error",$Desc="A Fatal Error Has Occurred",$ExitCode = -99,$TimeOut = 0)
  MsgBox(0,$Title,$Desc,$TimeOut)
  Exit $ExitCode
EndFunc

Generates a MsgBox and Exits with $ExitCode with just _FatalError()


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

yeah as valuater said, the only place i really use variables is if im using the same thing alot hence stuff with files , but other then that if your doing a simple messagebox like that just do "hi" not the variable

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  
Followers 0