Jump to content

New Macro For Switch/endswitch.


Recommended Posts

Is it possible to add a micro that will keep the value of the object passed to the switch

Instead of doing this:

$Value = fucntion()
switch $value
    case 1
          msgbox( 0 , '' , '$Value ='& $value)
    case else
          if $value > 1 and @error and function() then
              swtich $value
                  case 2
            ;I don't know
              endswitch
           endif
endswitch

Will do this:

switch fucntion()
    case 1
          msgbox( 0 , '' , '$Value ='& @MACRO)
    case else
          if @MACRO > 1 and @error and function then
              swtich  @MACRO
                  case 2
            ;I don't know
              endswitch
           endif
endswitch

As you can see I didn't even use one variable. :)

This is just to add another cool thing that makes thing easy and writing short scripts easier in addition that reading the script (by the user)will be easier and faster especially for no experienced script writers.

thanks

Typos

Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Link to comment
Share on other sites

So you think a new user is going to find it easier to understand that an invisible "variable" gets assigned a value as opposed to explicitly seeing a value assigned? All I see is a savings of one line of code with a small negative impact on readability.

Link to comment
Share on other sites

So you think a new user is going to find it easier to understand that an invisible "variable" gets assigned a value as opposed to explicitly seeing a value assigned? All I see is a savings of one line of code with a small negative impact on readability.

That was extra crap; I should've taken out "especially for no experienced script writers."

But anyway I just thought it's good to have some thing like this(If its not hard).

Should I expect anything like that to be done? Yes or No :)

Thanks

Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

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

  • Recently Browsing   0 members

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