Clearing Array

Get help using Construct 2

Post » Mon Nov 21, 2016 7:00 am

Hi, Basically I'm wondering if it's possible to clear an Array to no value, rather than 0. I'm trying to save strings of text into an array, but each line of text is being saved as - 0Level1, 0Level2.. etc.

Basically I'm trying to clear the array before I load the saved Strings onto the array at the start of the layout.
Thanks.
B
17
S
2
Posts: 26
Reputation: 819

Post » Mon Nov 21, 2016 9:01 am

on start of layout set size to 1,1,1. Pretty much clears out all the zero data and makes for easier pushing and popping.
B
53
S
21
G
95
Posts: 2,453
Reputation: 56,121

Post » Mon Nov 21, 2016 9:35 am

Doesn't seem to do much. What I am doing for example -
On item "SAVE" exists -
Set Global Variable "Level 1 Words" to Array.At(1,0,0)
Set Global Variable "Level 2 Words" to Array.At(2,0,0) etc..

But if there is no previous data stored in the array, by default it will set the Variable to 0 and because the text is being displayed, it shows a 0, when I would prefer it to show nothing at all.
Hope this makes sense. Thanks
B
17
S
2
Posts: 26
Reputation: 819

Post » Mon Nov 21, 2016 9:58 am

Okay I seemed to have fixed it by adding -
if "Level 1 words" = "0" - set "Level 1 Words to ""
B
17
S
2
Posts: 26
Reputation: 819


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests