I just don't understand how ArgumentCount works

Palma Colapietro 136 Reputation points
2021-07-14T18:10:51.753+00:00

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

BS

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

Accepted answer
  1. WhTurner 1,611 Reputation points
    2021-07-15T13:42:05.067+00:00

    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
    2021-07-15T19:25:07.91+00:00

    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.