educador Posted January 26, 2024 Posted January 26, 2024 (edited) .add and subtract parameters is a program that allows you to provide several numbers as parameters when running it. Then, it adds or subtracts these numbers and shows you the result. $totalparametros = $CmdLine[0] $capturaroperacion = "nada" MsgBox(0, "Bienvenidos a sumatorio", "El nombre del programa es:" & @ScriptName) If $CmdLine[1] = "suma" Then $capturaroperacion = "Suma" EndIf If $CmdLine[1] = "resta" Then $capturaroperacion = "Resta" EndIf $totaloperacion = 0 For $i = 2 To $totalparametros If $capturaroperacion = "Suma" Then $totaloperacion = $CmdLine[$i] + $totaloperacion EndIf If $capturaroperacion = "Resta" Then If $i = 2 Then ; Si es el primer número en la resta, restar de 0 $totaloperacion = $CmdLine[$i] Else ; Restar los números siguientes $totaloperacion = $totaloperacion - $CmdLine[$i] EndIf EndIf Next MsgBox(0, "numeros", $CmdLineRaw) MsgBox(0, "operacion", $totaloperacion) se debe utilizar el CMD Edited January 26, 2024 by Jos Please use English only!
Developers Jos Posted January 26, 2024 Developers Posted January 26, 2024 (edited) Moved to the appropriate forum and machine translated to English. Moderation Team Edited January 26, 2024 by 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.
argumentum Posted January 26, 2024 Posted January 26, 2024 2 hours ago, educador said: is a program that allows you to provide several numbers So, there is no question. This is something you are sharing. Right ? Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
educador Posted January 26, 2024 Author Posted January 26, 2024 Yes,If it is a program that I wanted to share, it is nothing out of this world, probably very simple, but in case it helps someone
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now