Skip to content

Integer to string casting and more string blocks #351

Open
@DoomTas3r

Description

@DoomTas3r

Code_It_All made this video using version 0.8.0, but could not cast an integer to a string.

Perhaps make all string parameters accept only strings or improve implicit casting
Parser Error: Value of type "int" cannot be assigned to a variable of type "String".
image

A Text category could be added for these string-related blocks:

  1. (float) to string
  2. length of (string)
  3. letter (integer) of (string)

And maybe more complex blocks:

  1. replace (string1) with (string2) in (string3)
  2. slice (integer) of (string1) split by (string2)

And finally, the concat block's label could change to differentiate from the add block, for example: join (string1) (string2)

The current concat block allows both strings and integers to be added, but it compiles to string + integer, which produces an error
Parser Error: Invalid operands "String" and "int" for "+" operator.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions