I just don't understand how ArgumentCount works

Palma Colapietro 136 Reputation points

In the Small Basic Program class contains the property ArgumentCount.
How does it work ?


A programming language created by Microsoft that serves a stepping stone for beginners from block-based coding languages to more complex text-based languages.
269 questions
0 comments No comments
{count} votes

Accepted answer
  1. WhTurner 1,611 Reputation points

    The Program.Argumentcount statement returns the number of arguments given in the call of the program.
    If you write a program test.sb and compile it by running you get a test.exe in the same directory.
    if you start a cmd window in Windows, goto the smallbasic directory and execute the exe file by calling test.exe 2 4 6 ,
    the argumentcount becomes 3, you can use the argument(s) through e.g. Program.GetArgument(2) which is then 4

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Palma Colapietro 136 Reputation points

    So it is only about the program launch parameters, it is not about the body of the code itself. Quite right ?

    0 comments No comments