How to get an integer from the user

It absolutely hurts to ask such a dumb question, but I’ve scoured the literature and I can’t find anything that describes, in simple terms, how to ask the user, “How many do you want?” and then get an integer that I can use.

This seems like overkill, but it’s what I’ve gleaned from the RhinoCommon documentation

        var gn = new Rhino.Input.Custom.GetNumber( );
        gn.SetCommandPrompt("Number of stations");
        gn.Get();
        RhinoApp.WriteLine("Create {0} stations:", gn.Number());

This last line accurately reports how many stations the user entered, however, I can’t use gn.Number() as an integer when trying to construct that many stations.

I tried declaring gn as an int, but I got massive compile errors.

I also tried

         int Stas = 0;
         GetInteger("Number of stations", false, Stas);

but it won’t compile.

Hello,

How about adding ref?

int Stas = 0;
GetInteger(“Number of stations”, false, ref Stas);

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Input_RhinoGet_GetInteger.htm

Thx, but I still get compile errors.

        GetInteger("Number of stations", false, ref Stas);

|Error|CS1955|Non-invocable member ‘GetInteger’ cannot be used like a method.

I also tried

        Rhino.Input.GetInteger("Number of stations", false, ref Stas);

|Error|CS0234|The type or namespace name ‘GetInteger’ does not exist in the namespace ‘Rhino.Input’ (are you missing an assembly reference?)

using System;
using Rhino;

int getIntger = 0;
Rhino.Input.RhinoGet.GetInteger(“Number of stations”,false,ref getIntger);

Thx. I found it, too. I wonder how many times I went right past it.

        int stas = 0;
        Rhino.Input.RhinoGet.GetInteger("Number of stations", false, ref stas);