Issues with Print function

So I’ve just started dipping my toes into Verse, I come from an experienced developer background and I find myself stumped in messing around with my first Hello World program. Lol. Surely I’m missing something, but in the case that I’m not, I thought I’d share here in case others see the same.

Here is my code:

hello_world_device := class(creative_device):

    # Runs when the device is started in a running game
    OnBegin<override>()<suspends>:void=
        # TODO: Replace this with your code
        var HelloWorld : []char = "Hello, world!"
        var ColorRed : color = MakeColorFromSRGB(1.0,0.0,0.0)
        var DurationFive : float = 5.0
        var args : tuple([]char, float, color) = (HelloWorld, DurationFive, ColorRed)
        Print(args)
        Print("2 + 2 = {2 + 2}")

Very simple, yet I see this bizarre syntax error in VSCode:
This function parameter expects a value of type tuple([]char,?Duration:float = ...,?Color:color = ...), but this argument is an incompatible value of type tuple([]char,float,color).

It’s my understanding that the ‘?’ character prior to the argument in the function definition denotes that the argument is optional. Since I’m providing the correct types, whats the reasoning for this error? Hopefully I’m not missing anything too blatantly obvious here. Thanks!

looking in the Verse.digest.verse file it seems like the duration and color is handled externally. unless a staff wants to correct me i dont think you can change them

    # Send messages to the default print log. Duration will determine how long the message will remain on the client screen, default 2.0 seconds. Color will determine the color of the message displayed on the client screen, default is White.
    Print<native><public>(Message:[]char, ?Duration:float = external {}, ?Color:color = external {}):void

You can use the Color argument with Print(), though worth noting that the color only shows up in the top left of the screen, and not in the log in the game or in UEFN.

The real problem you have is that AFAIK there is no way to put optional/named arguments in a tuple (I’ve tried every syntax I can think of for it, and it just doesn’t work right now… maybe it’s coming in the future?). Also the way Verse works is not like some other languages (ex C#) where you can pass optional arguments in the specified order OR with their names. You have to pass them by name in Verse. So without using the tuple, this is how you do it:

Print(HelloWorld, ?Duration := DurationFive, ?Color := ColorRed)

Thanks for your replies on this folks. @MattRix was correct with his suggestion here.

Also the way Verse works is not like some other languages (ex C#) where you can pass optional arguments in the specified order OR with their names. You have to pass them by name in Verse.

It would be fantastic if there were a knowledge-base for programmers coming from different common backgrounds. I understand this is still a young language and that would come with time, but wishful thinking at least!

Thanks for the quick resolution with this one.

Displays a Green Int for 10 seconds.

using { /Verse.org/Colors }
var ItemIndex : int = 1;
Print(“ItemIndex:{ItemIndex}”, ?Duration := 10.0, ?Color := NamedColors.Green)

Hope this helps.