I created a simple Integer formatting function that let's you right align an integer image in a string with a specified width.
It's defined as:
func Format(Format_Str : Univ_String; Value : Univ_Integer) -> Univ_String
An example call to Format is:
var y := "3d".Format(x)
The above works just fine, but seems a little "wordy".
So, in the spirit of the ` operator, I tried to replace Format with "+" using the declaration:
op "+"(Format_Str : Univ_String; Value : Univ_Integer) -> Univ_String is Format;
But, I can't get this operator to work at all.
I tried:
y := "3d"+x;
y := "3d"."+"(x);
y := "+"("3d",x);
y := Univ_String::"+"("3d",x);
none of which worked.
I get errors similar to:
Error: use of op "+" not resolved:
Info: "3d" + x
Info: operand's type Univ_String<> does not match param type Univ_Integer<>
Info: operand "3d" does not match Left : Univ_Integer
Error: Cannot resolve type:
What am I doing wrong?
I attached a working example with the non-working lines commented out.