Nuclear Detergent
Member
I'm having trouble wrapping my brain around strings, and especially how string_delete works.
I'm trying to store characters from keyboard_string in two different variables with different lenghts. One of the variables is used to store only 1 character (output), which refreshes everytime something new is put into keyboard_string, while I want (variable - not yet made) to just store the whole keyboard_string. So far I've tried several approaches, but I think I don't quite grasp how string_delete works. Here's the code:
This is just my latest approach, which seems to work for the first two times an input is made, but then the string (output) just adds numbers to itself, instead of adding and subtracting, going beyond 2 breaking the code.
Any ideas would be much appreciated?
I'm trying to store characters from keyboard_string in two different variables with different lenghts. One of the variables is used to store only 1 character (output), which refreshes everytime something new is put into keyboard_string, while I want (variable - not yet made) to just store the whole keyboard_string. So far I've tried several approaches, but I think I don't quite grasp how string_delete works. Here's the code:
Code:
input = keyboard_string;
output = string_delete(input, 1, 1);
if string_length(output) > 1
{
output = string_delete(output, 1, 1);
}
Any ideas would be much appreciated?
Last edited: