1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

GM:S 1.4 Trying to get a string to delete when characters are typed

Discussion in 'Programming' started by PhenomenalDev, Jun 19, 2019.

  1. PhenomenalDev

    PhenomenalDev Member

    Joined:
    Jan 5, 2017
    Posts:
    121
    Trying to make it so when a character of a string is typed it gets deleted from the string but so far it's not working since I'm having trouble reading the user input.

    Here is my code:
    if keyboard_check_pressed(ord(string_upper(string_char_at(text,1))))
    {
    text = string_delete(text,0,1)
    }

    Edit: Solved it, index was set to 0 when string index starts at 1 for some reason.
     
  2. MIchael PS

    MIchael PS Member

    Joined:
    Aug 12, 2017
    Posts:
    95
    Please, edit ur tittle and add a [Solved] at the beginning so that people won't come accidentally here. Anyway good job and good luck with your project!!!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice