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
16
S
1
Posts: 26
Reputation: 644

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
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

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
16
S
1
Posts: 26
Reputation: 644

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
16
S
1
Posts: 26
Reputation: 644


Return to How do I....?

Who is online

Users browsing this forum: sean080, yiuyiu6666 and 27 guests