|
||
|
|
#1 (permalink) |
|
Forum Expert
|
in this line how can i take all entries and add them to string with all upper cap?
for (int i = 0; i < nodItems.Count; i++) itemcheckarray[i] = nodItems[i].InnerText.ToUpper ToString(); ***edit** nm i found out, bt now the problem is i cant get them back to the original before printing it, so i made that. Code:
string strsearchentry = this.textBox1.Text.ToUpper();
XmlElement nodRoot = docXML.DocumentElement;
XmlNodeList nodItems = nodRoot.GetElementsByTagName("nom");
int p = nodItems.Count;
string[] itemsarray = new string[p];
string[] itemsarrayor = new string[p];
for (int i = 0; i < nodItems.Count; i++)
{
itemsarray[i] = nodItems[i].InnerText.ToUpper();
itemsarrayor[i] = nodItems[i].InnerText.ToString();
}
Code:
foreach (string item in itemsarray)
{
if (item.Contains(strsearchentry))
{
offset = 3;//****get the offset of the item entry***
//call method to add the original item entry to a list box that need the offset value of the item
}
}
__________________
Admin of Crystal World, French shard Under Construction http://www.crystalworld.over-blog.com/ If there is another lifeform in the universe, they are wise enough to avoid our babaric civilisation. Last edited by jocan2003; 04-19-2007 at 01:51 AM. |
|
|
|
|
|
#2 (permalink) | |
|
RunUO Forum Moderator
|
Quote:
Code:
stringBuilder sb = new stringBuilder(); for (int i=0; i<nodItems.Count; i++) sb.Append(nodItems[i].InnerText.ToUpper().ToString()); string fullString = sb.ToString();
__________________
I always try to help
![]() Sometimes, I don't know how.... ![]() My Web Page Forum Rules ------------------------------------------------------------- Extensive OWLTR System | Token System | World Teleporters ------------------------------------------------------------- |
|
|
|
|
|
|
#3 (permalink) |
|
Forum Expert
|
it doesnt tell me the offest the value will used, thats the only thing i need ot know for now, beside that i got everything working, well maybe not now because i mess a lot trying to find a way, but i have a working copy just before i mess out
.First i started by declaring some parameter wich are these one. Code:
private int _offset;
private string[] _itemsarrayor;
private string _stradd;
public int offset
{
get { return _offset; }
set { _offset = value; }
}
public string[] itemsarrayor
{
get { return _itemsarrayor; }
set { _itemsarrayor = value; }
}
public string stradd
{
get { return _stradd; }
set { _stradd = value; }
}
Code:
private string SendOValue( int offset )
{
return stradd = itemsarrayor[offset].ToString();
}
Code:
private void button3_Click(object sender, EventArgs e)
{
Form2 fm = new Form2();
XmlDocument docXML = new XmlDocument();
docXML.Load("Liste.xml");
string strsearchentry = this.textBox1.Text.ToUpper();
XmlElement nodRoot = docXML.DocumentElement;
XmlNodeList nodItems = nodRoot.GetElementsByTagName("nom");
int p = nodItems.Count;
string[] itemsarray = new string[p];
string[] itemsarrayor = new string[p];
for (int i = 0; i < nodItems.Count; i++)
{
itemsarray[i] = nodItems[i].InnerText.ToUpper();
itemsarrayor[i] = nodItems[i].InnerText.ToString();
}
foreach (string item in itemsarray)
{
if (item.Contains(strsearchentry))
{
offset = ?? ;//****get the offset of the item entry***
stradd = SendOValue(offset);
fm.listBox1.Items.Add(stradd);
}
}
fm.Show();
Code:
foreach (string item in itemsarray)
{
if (item.Contains(strsearchentry))
{
offset = ?? ;//****get the offset of the item entry***
stradd = SendOValue(offset);
fm.listBox1.Items.Add(stradd);
}
}
![]()
__________________
Admin of Crystal World, French shard Under Construction http://www.crystalworld.over-blog.com/ If there is another lifeform in the universe, they are wise enough to avoid our babaric civilisation. |
|
|
|
|
|
#5 (permalink) |
|
Forum Expert
|
thanks instead i made a new int with value 0 and time it was itarating a new time int was increased by one, wich worked fine.
__________________
Admin of Crystal World, French shard Under Construction http://www.crystalworld.over-blog.com/ If there is another lifeform in the universe, they are wise enough to avoid our babaric civilisation. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|