Morgoth
02-22-2003, 04:56 AM
Ok, I have a system set up to read a title, or a name for a certain product in something like a table.
An example of that table is here(save as .html to view):
<table border="1">
<tr>
<td align="center">0</td>
<td align="center">0-10</td>
<td align="center">10-20</td>
<td align="center">20-30</td>
</tr>
<tr>
<td align="center">0-10</td>
<td>Name 1A</td>
<td>Name 2A</td>
<td>Name 3A</td>
</tr>
<tr>
<td align="center">10-20</td>
<td>Name 1B</td>
<td>Name 2B</td>
<td>Name 3B</td>
</tr>
<tr>
<td align="center">20-30</td>
<td>Name 1C</td>
<td>Name 2C</td>
<td>Name 3C</td>
</tr>
</table>
[Y(v=down) X(>=Right)]
Now, I don't LITERALLY have a table set up like this, I have a function that looks like this (all if statements):
If X => 0 And X =< 10 Then
If Y => 0 And Y =< 10 Then
Name = 1A
ElseIf Y => 10 And Y =< 20 Then
Name = 2A
ElseIf Y => 20 And Y =< 30 Then
Name = 3A
End If
ElseIf X => 10 And X =< 20 Then
If Y => 0 And Y =< 10 Then
Name = 1B
ElseIf Y => 10 And Y =< 20 Then
Name = 2B
ElseIf Y => 20 And Y =< 30 Then
Name = 3B
End If
ElseIf X => 20 And X =< 30 Then
If Y => 0 And Y =< 10 Then
Name = 1C
ElseIf Y => 10 And Y =< 20 Then
Name = 2C
ElseIf Y => 20 And Y =< 30 Then
Name = 3C
End If
End If
Now first off, just so you know, because I chose 1A, 1B, 1C, 2A, etc, does not mean there is a pattern in what 'Name' equals. Name acually equals a unique string.
And so what I am trying to ask and find out, is if there is a much easier way to do this. Meaning not use all these if statements in this sort of way. Is there a better way?
Any suggestions will help.
An example of that table is here(save as .html to view):
<table border="1">
<tr>
<td align="center">0</td>
<td align="center">0-10</td>
<td align="center">10-20</td>
<td align="center">20-30</td>
</tr>
<tr>
<td align="center">0-10</td>
<td>Name 1A</td>
<td>Name 2A</td>
<td>Name 3A</td>
</tr>
<tr>
<td align="center">10-20</td>
<td>Name 1B</td>
<td>Name 2B</td>
<td>Name 3B</td>
</tr>
<tr>
<td align="center">20-30</td>
<td>Name 1C</td>
<td>Name 2C</td>
<td>Name 3C</td>
</tr>
</table>
[Y(v=down) X(>=Right)]
Now, I don't LITERALLY have a table set up like this, I have a function that looks like this (all if statements):
If X => 0 And X =< 10 Then
If Y => 0 And Y =< 10 Then
Name = 1A
ElseIf Y => 10 And Y =< 20 Then
Name = 2A
ElseIf Y => 20 And Y =< 30 Then
Name = 3A
End If
ElseIf X => 10 And X =< 20 Then
If Y => 0 And Y =< 10 Then
Name = 1B
ElseIf Y => 10 And Y =< 20 Then
Name = 2B
ElseIf Y => 20 And Y =< 30 Then
Name = 3B
End If
ElseIf X => 20 And X =< 30 Then
If Y => 0 And Y =< 10 Then
Name = 1C
ElseIf Y => 10 And Y =< 20 Then
Name = 2C
ElseIf Y => 20 And Y =< 30 Then
Name = 3C
End If
End If
Now first off, just so you know, because I chose 1A, 1B, 1C, 2A, etc, does not mean there is a pattern in what 'Name' equals. Name acually equals a unique string.
And so what I am trying to ask and find out, is if there is a much easier way to do this. Meaning not use all these if statements in this sort of way. Is there a better way?
Any suggestions will help.