Quote from: Atelier on Thu 02/04/2015 22:39:46
I feel honored for Symbiosis to be on the "guidelines" image.

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Atelier on Thu 02/04/2015 22:39:46
// GlobalScript.asc
int THING = 1;
export THING;
// GlobalScript.ash
// empty (I don't want to access THING from room scripts, so I don't have to import it here, right?
// AnotherScript.ash
import int THING;
// AnotherScript.asc
// ... some code ...
THING = 2;
// ... more code ...
// Pattern struct
struct Pattern
{
String name;
String type;
String discoverer;
String year;
bool patternGrid[CELL_NUMBER];
};
// [GLOBAL] Loaded patterns
import Pattern patterns[200];
import int patternCount;
// Add the new pattern to the array
patterns[patternCount].name = txtPatternName.Text;
patterns[patternCount].type = txtPatternType.Text;
patterns[patternCount].discoverer = txtDiscoverer.Text;
patterns[patternCount].year = txtYear.Text;
// Add the new pattern item to the list
lstPatterns.AddItem(String.Format("%s", patterns[patternCount].name.Truncate(13)));
// Increase pattern count
patternCount = patternCount + 1;
// Select the new pattern in the list
lstPatterns.SelectedIndex = lstPatterns.ItemCount - 1;
lblName.Text = patterns[lstPatterns.SelectedIndex].name;
lblType.Text = patterns[lstPatterns.SelectedIndex].type;
lblDiscoverer.Text = patterns[lstPatterns.SelectedIndex].discoverer;
lblYear.Text = patterns[lstPatterns.SelectedIndex].year;
lblName.Text = patterns[lstPatterns.SelectedIndex].name;
Quote from: Crimson Wizard on Mon 03/11/2014 23:20:57
Which line in your script is highlighted when you got this error?
lblName.Text = patterns[lstPatterns.SelectedIndex].name;
function lstPatterns_OnSelectionChanged(GUIControl *control)
{
if (lstPatterns.SelectedIndex != -1)
{
lblName.Text = patterns[lstPatterns.SelectedIndex].name;
lblType.Text = patterns[lstPatterns.SelectedIndex].type;
lblDiscoverer.Text = patterns[lstPatterns.SelectedIndex].discoverer;
lblYear.Text = patterns[lstPatterns.SelectedIndex].year;
}
else
{
lblName.Text = "- - -";
lblType.Text = "- - -";
lblDiscoverer.Text = "- - -";
lblYear.Text = "- - -";
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.037 seconds with 13 queries.