C
C#8mo ago
Rykorra

✅ Help Validating user inputs into Text Boxes

I am currently a student in a C# class we have a shipping Calculator project due and I am having problems making sure that only North, South, East, and West is input into the zone text box please help? I am also having to use a switch {case...} for determining the cost for the shipment, If i could possible get some help with that as well that would be great.
237 Replies
Rykorra
Rykorra8mo ago
My class uses visual studio if you would need to have that information.
JakenVeina
JakenVeina8mo ago
$details
MODiX
MODiX8mo ago
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, and what you expect the result to be. Upload code here https://paste.mod.gg/ (see $code for more information on how to paste your code)
Rykorra
Rykorra8mo ago
So I don't think my code will help at this time because I think a majority of it is incorrect for what I need to do for this project is there maybe some other way I can get you the info you need. I can upload my assignment sheet or maybe get you in a voice chat? Here is the code I have anyways https://paste.mod.gg/ncpvtydszvvu/0
BlazeBin - ncpvtydszvvu
A tool for sharing your source code with the world!
JakenVeina
JakenVeina8mo ago
so you have a textbox and you want to limit the user to only inputting "North", "South", "East", and "West"?
Rykorra
Rykorra8mo ago
correct VALIDATION: Validate that the package weight entered is numeric and greater than zero. Validate that a non-blank shipping zone letter code was entered. If the user entered a shipping zone letter code other than the valid codes mentioned below, then display an error message indicating this to the user, and do not calculate the shipping costs. this is the exact wording the professor used
JakenVeina
JakenVeina8mo ago
ah so no you do not want to limit the user to only inputting "North", "South", "East", and "West" you want to limit the user to only inputting some "zone letter code" values what are the valid "zone letter code"s
Rykorra
Rykorra8mo ago
N S E W
JakenVeina
JakenVeina8mo ago
also, that doesn't specify use of a "textbox" anywhere don't use a textbox unless that's specified somewhere else in the problem
Rykorra
Rykorra8mo ago
INPUT: Create text boxes to accept the input of a package’s weight and another text box to accept the input of a shipping zone letter code (assume shipping zone letter codes of N, S, E, W) with zone rates as described below.
JakenVeina
JakenVeina8mo ago
use a dropdown selector or radio buttons okay so
Validate that a non-blank shipping zone letter code was entered
If the user entered a shipping zone letter code other than the valid codes mentioned below, then display an error message indicating this to the user
so, what are you having trouble with?
Rykorra
Rykorra8mo ago
If I am going to be honest most everything with this course so far. I can look at code and understand what things are going to do but I am having a hard time determining where code needs to go. I understand what I am needing to do. Just do not know how to execute it.
JakenVeina
JakenVeina8mo ago
cracks knuckles where do you want to start?
Rykorra
Rykorra8mo ago
I guess with my first bit i have to do. which is that input section you saw
JakenVeina
JakenVeina8mo ago
the shipping zone bit?
Rykorra
Rykorra8mo ago
JakenVeina
JakenVeina8mo ago
lovely aha AND you have a calculate button that is very telling
Rykorra
Rykorra8mo ago
yes making sure i can validate the letter codes
JakenVeina
JakenVeina8mo ago
so A) you need input controls which you have B) you need to DO something with them when are we going to DO things?
Rykorra
Rykorra8mo ago
when text is added into the text box? or when the calculate button is pressed?
JakenVeina
JakenVeina8mo ago
does the problem specify? if not, what makes more sense to you?
Rykorra
Rykorra8mo ago
it does not specify but for me it would be when the calculate button is pressed
JakenVeina
JakenVeina8mo ago
I would agree if you're going to HAVE a calculate button, that indicates to the user that they're responsible for making things happen you definitely COULD have things automatically update whenever text is entered but then what's the point of having a button at all? so, now our job is "write code to run when the button is clicked"
Rykorra
Rykorra8mo ago
exactly i think i have been doing that in line 28
JakenVeina
JakenVeina8mo ago
assuming that method is attached to the Click event of the calculate button, yes the other handlers you can get rid of now, what do we need to DO within that method?
Rykorra
Rykorra8mo ago
the shipzonetb_ttextchanged and the packwght tb_text changed?
JakenVeina
JakenVeina8mo ago
you wanted to start with the shipping zone input? yes, we've just established you don't want to do anything when text changes
Rykorra
Rykorra8mo ago
okay one sec
Rykorra
Rykorra8mo ago
I am getting errors
JakenVeina
JakenVeina8mo ago
what do they say? rather, what do you think they're telling you? what does that text mean?
Rykorra
Rykorra8mo ago
that there was a function given to those events and the code no longer has the event trigger
JakenVeina
JakenVeina8mo ago
roughly correct you have removed the methods you did not remove other code that refers to those methods the code that actually attaches those methods to the textbox events double-click on the error to see
Rykorra
Rykorra8mo ago
ahh okay we have not got to the designer yet in class
JakenVeina
JakenVeina8mo ago
I mean you're using it so, yeah, you have you're getting a peek into what the Designer DOES for you, which is that it just generates C# code don't edit that file but that file didn't come from nowhere if the Designer generated a reference to a method that doesn't exist, that's becuase you told it to go into the Designer and remove the thing that tells it to do that
Rykorra
Rykorra8mo ago
awesome okay got it The total shipping cost amount is equal to the ‘weight cost’ plus the ‘zone cost’ and is calculated as follows: $18.00 PER POUND ‘weight cost’ PLUS: $27.00 ‘zone cost’ FLAT surcharge if shipped to zone N $36.00 ‘zone cost’ FLAT surcharge if shipped to zone S $45.00 ‘zone cost’ FLAT surcharge if shipped to zone E $54.00 ‘zone cost’ FLAT surcharge if shipped to zone W this is also how he wants us to price out things figured i would give you this as well since it will be relevant
JakenVeina
JakenVeina8mo ago
I saw what are we working on right now?
Rykorra
Rykorra8mo ago
I would say lets start with the Shipping zone code and making sure that the correct zone cost is put in
JakenVeina
JakenVeina8mo ago
great what do we need to do with the shipping zone code?
Rykorra
Rykorra8mo ago
ensure that the N S E W are put into the Shipping zone TB
JakenVeina
JakenVeina8mo ago
what does our code need to do in order to accomplish that
Rykorra
Rykorra8mo ago
read the text box for that text and if it does not read any of those zone codes then display to enter a valid code
JakenVeina
JakenVeina8mo ago
read the text box for that text
what's the code for this?
Rykorra
Rykorra8mo ago
would that be a .Parse?
JakenVeina
JakenVeina8mo ago
which .Parse()?
Rykorra
Rykorra8mo ago
.Parse(ShipZoneTB.text)?
JakenVeina
JakenVeina8mo ago
what are you calling .Parse() on? there's a lot of different .Parse() methods out there which one are you talking about?
Rykorra
Rykorra8mo ago
ahhhh So i would start with north so maybe zoneN = ___.Parse(ShipZoneTB.Text)?
JakenVeina
JakenVeina8mo ago
uhm no also no
Rykorra
Rykorra8mo ago
dang
JakenVeina
JakenVeina8mo ago
you're getting farther and farther from the actual question
read the text box for that text
how do you read text from a text box?
Rykorra
Rykorra8mo ago
decimal.Parse(ShipZoneTB.Text) I feel like that is wrong cause that would be a number no?
JakenVeina
JakenVeina8mo ago
it would I mean it's also kinda right
Rykorra
Rykorra8mo ago
int?
JakenVeina
JakenVeina8mo ago
but yeah, why are you parsing the text into a decimal? do we WANT a decimal?
Rykorra
Rykorra8mo ago
no we want a letter Isletter.Parse?
JakenVeina
JakenVeina8mo ago
why are you so stuck on a Parse method?
read the text box for that text
where in here are we discussing parsing text?
var shipZoneCode = ShipZoneTB.Text;
var shipZoneCode = ShipZoneTB.Text;
Rykorra
Rykorra8mo ago
I am not sure I apologize
JakenVeina
JakenVeina8mo ago
nothing to apologize for so, next step
if it does not read any of those zone codes
what's the code we need for this?
Rykorra
Rykorra8mo ago
I am not sure exactly.
JakenVeina
JakenVeina8mo ago
well, the word "if" in that sentence should be your biggest clue
Rykorra
Rykorra8mo ago
okay so if (ShipZoneTB.Text
JakenVeina
JakenVeina8mo ago
you can do that, if you want or you can use the variable, like I demonstrated above
Rykorra
Rykorra8mo ago
if (shipZoneCode
JakenVeina
JakenVeina8mo ago
since we're going to be checking the text value multiple times, probably better to use a reusable vairable and what are we checking shipZoneCode for?
Rykorra
Rykorra8mo ago
if (shipZoneCode is "N" etc?
JakenVeina
JakenVeina8mo ago
try it
Rykorra
Rykorra8mo ago
says cannot implicitly conver type 'string' to system windows form tb
JakenVeina
JakenVeina8mo ago
on what code?
Rykorra
Rykorra8mo ago
if (shipZoneCode is "n");
JakenVeina
JakenVeina8mo ago
what is shipZoneCode?
Rykorra
Rykorra8mo ago
ShipZoneTB?
JakenVeina
JakenVeina8mo ago
why? is that what we said we needed? a reference to the entire textbox?
Rykorra
Rykorra8mo ago
no just the text inside it
JakenVeina
JakenVeina8mo ago
so, what is the code you wrote to do that?
Rykorra
Rykorra8mo ago
I don't think I have written that yet?
JakenVeina
JakenVeina8mo ago
so... do it
Rykorra
Rykorra8mo ago
I apologize for taking up an hour of your time. I seem to not be able to understand what is needed. I will speak with my professor about it when I see him next. Thank you giving me your insight though it meant a lot.
JakenVeina
JakenVeina8mo ago
I'm just chillin' working on other stuff you're not imposing at all, that's what I'm here for I'm good to keep going if you are recap:
Validate that a non-blank shipping zone letter code was entered
If the user entered a shipping zone letter code other than the valid codes mentioned below, then display an error message indicating this to the user
this is what we need to do which you then distilled down to this
read the text box for that text and if it does not read any of those zone codes then display to enter a valid code
then we identified the first stop of that, and wrote code for it
read the text box for that text
var shipZoneCode = ShipZoneTB.Text;
var shipZoneCode = ShipZoneTB.Text;
now, we're working on the second step
if it does not read any of those zone codes
for which you wrote
if (shipZoneCode is "n");
if (shipZoneCode is "n");
you said that was giving you an error, and then you told me you never added the first bit of code that we wrote to your actual program you need to do that
Rykorra
Rykorra8mo ago
okay I am good to keep going I have added the var shipZoneCode = ShipZoneTB.text;
Rykorra
Rykorra8mo ago
this is the error code it is giving me
JakenVeina
JakenVeina8mo ago
on what line of code?
Rykorra
Rykorra8mo ago
if (shipZoneCode is "n")
JakenVeina
JakenVeina8mo ago
and what is shipZoneCode?
Rykorra
Rykorra8mo ago
var shipZoneCode = ShipZoneTB;
JakenVeina
JakenVeina8mo ago
so when you said you in fact did not do this you have defined a variable shipZoneCode and given a value of ShipZoneTB I.E. a reference to the entire texbox then, you are attempting to compare that TextBox object against a string literal and the compiler correctly tells you that's nonsense there is no automatic conversion between those types
Rykorra
Rykorra8mo ago
so i need to define other variables?
JakenVeina
JakenVeina8mo ago
no, you need to take the line of code that we wrote here in Discord and put it in your program correctly
Rykorra
Rykorra8mo ago
just so i am clear the var needs to be changed correct?
JakenVeina
JakenVeina8mo ago
no
var shipZoneCode = ShipZoneTB.Text;
var shipZoneCode = ShipZoneTB.Text;
var shipZoneCode = ShipZoneTB;
var shipZoneCode = ShipZoneTB;
what is the difference between these two lines?
Rykorra
Rykorra8mo ago
this? the first looks at the text as the other looks at the box gotcha got it no error I have added if statements for all the directions into the code
JakenVeina
JakenVeina8mo ago
let's see
Rykorra
Rykorra8mo ago
BlazeBin - zctrgqycjuwc
A tool for sharing your source code with the world!
Rykorra
Rykorra8mo ago
So now i need to add the is not one of those to have a message box that says please use one of them
JakenVeina
JakenVeina8mo ago
how do you want to display that message to the user?
Rykorra
Rykorra8mo ago
would that be an else statement?
JakenVeina
JakenVeina8mo ago
that would be one way to accomplish it doesn't fit with what you've written so far
Rykorra
Rykorra8mo ago
okay what do you recommend?
JakenVeina
JakenVeina8mo ago
I'm going to recommend that you do what makes sense to you
Rykorra
Rykorra8mo ago
what makes sense to me would be to have a message box pop up saying "Please enter a valid Zone Code"
JakenVeina
JakenVeina8mo ago
great let's do that what's the code to do that?
Rykorra
Rykorra8mo ago
MessageBox.Show("Please Enter A Valid Zone Code");
JakenVeina
JakenVeina8mo ago
looks good to me now, where do we put that? I.E. when do we want that to run?
Rykorra
Rykorra8mo ago
when the calc button is clicked I have it right now under my if statements
JakenVeina
JakenVeina8mo ago
when the button is clicked, sure, but ALWAYS when the button is clicked?
Rykorra
Rykorra8mo ago
i see why you asked that question cause it still popped up hmm
JakenVeina
JakenVeina8mo ago
you only want it to run when the ship code isn't one of the 4 acceptable values, yes?
Rykorra
Rykorra8mo ago
yes
JakenVeina
JakenVeina8mo ago
so, we need to put it somewhere the only runs when that is the case I.E. we need the program to make a decision about when to run it
Rykorra
Rykorra8mo ago
hmmm I am unsure maybe after the button is clicked but after it checks for the shipZoneCode?
JakenVeina
JakenVeina8mo ago
how do we make decisions in code?
Rykorra
Rykorra8mo ago
else MessageBox.Show("Please Enter A Valid Zone Code");? no that is not correct
Rykorra
Rykorra8mo ago
but that is displaying 4 of the message boxes
JakenVeina
JakenVeina8mo ago
indeed that's what you told it to do "if the code isn't n, display a message box" "if the code isn't s, display a message box" "if the code isn't e, display a message box" "if the code isn't w, display a message box"
Rykorra
Rykorra8mo ago
so i need to do is not one of those display the message box
JakenVeina
JakenVeina8mo ago
uhmm rephrase, please?
Rykorra
Rykorra8mo ago
is the text is no NSEW MessageBox.Show("Please Enter A Valid Zone Code");
JakenVeina
JakenVeina8mo ago
yeah if the code is NONE of those I.E. if ALL of those statements are true "if the code isn't n AND the code isn't s AND ..."
Rykorra
Rykorra8mo ago
it says the "not pattern" is not available in C# 7.3 please use language version 9.0 or greater if (shipZoneCode is not "n"(MessageBox.Show("Please Enter A Valid Zone Code")); this is what I was trying to do I am not sure where to put this message box i found this "&&" I feel like this needs to be in this code
JakenVeina
JakenVeina8mo ago
yeah, you can't use is not in C# 7.3 use != that is how you would combine conditions, to check whether all of them are true at once, definitely
Rykorra
Rykorra8mo ago
okay so these would be more if statements? or would this be an else
JakenVeina
JakenVeina8mo ago
both are possible if you were going to do it as a single if statement, what would that look like? any idea?
Rykorra
Rykorra8mo ago
else if (shipZoneCode != " " ) { MessageBox.Show ("Please enter a valid zone code") } ?
JakenVeina
JakenVeina8mo ago
that looks like an else if to me not "a single if statement"
Rykorra
Rykorra8mo ago
if (shipZoneCode != "n" ) { MessageBox.Show ("Please enter a valid zone code") }
JakenVeina
JakenVeina8mo ago
okay, but you already have that and it didn't work we were talking about how to check that the code is NONE of the 4 valid values in a single if statement
Rykorra
Rykorra8mo ago
I dont know how i would do that
Angius
Angius8mo ago
Hint: &&
JakenVeina
JakenVeina8mo ago
less-obvious hint: you already mentioned it earlier
Rykorra
Rykorra8mo ago
I am guessing you mean &&
JakenVeina
JakenVeina8mo ago
indeed
Rykorra
Rykorra8mo ago
if (shipZoneCode != "n" && "s" && "e" && "w")? { MessageBox.Show ("Please enter a valid zone code") }
Angius
Angius8mo ago
Almost
Rykorra
Rykorra8mo ago
else?
Angius
Angius8mo ago
&& is a boolean operator It works on booleans bool && bool shipZoneCode != "n" will resolve to a boolean But "s" is a string
JakenVeina
JakenVeina8mo ago
Alternatively, look at the error that gives you. It tells you that you can't convert a string to a bool, yes? That's meaningful, it tells you that you're passing a string to something that expects a bool.
Rykorra
Rykorra8mo ago
okay i see that error what should i do to fix it?
JakenVeina
JakenVeina8mo ago
don't pass a string to something that expects a boolean consider what Z said about how && works and consider what you're trying to do here you're trying to identify when the code does not meet certain conditions what are those conditions?
Rykorra
Rykorra8mo ago
when the text entered is not NSEW
JakenVeina
JakenVeina8mo ago
how many conditions is that?
Rykorra
Rykorra8mo ago
4
JakenVeina
JakenVeina8mo ago
write the code for each one
Angius
Angius8mo ago
Alternatively alternatively, pattern matching:
No description
JakenVeina
JakenVeina8mo ago
we already covered that not available in C# 7.3
Angius
Angius8mo ago
But chances are your teacher won't know wtf it is and will fail you Ah oof my condolences
Rykorra
Rykorra8mo ago
I am sorry I am very lost about how to code this
Angius
Angius8mo ago
How do you write "shipZoneCode is not n"?
Rykorra
Rykorra8mo ago
if (shipZoneCode != "n")
Angius
Angius8mo ago
Just the condition Without the if
JakenVeina
JakenVeina8mo ago
now how do you write "shipZoneCode is not s"?
Rykorra
Rykorra8mo ago
shipZoneCode != "s"
Angius
Angius8mo ago
And now, how do you write a condition that both must be true?
JakenVeina
JakenVeina8mo ago
given that && combines conditions and you have just written 2 conditions
Rykorra
Rykorra8mo ago
shipZoneCode != "n" && shipZoneCode != "s" && shipZoneCode != "e" && shipZoneCode != "w"
JakenVeina
JakenVeina8mo ago
🎉
Angius
Angius8mo ago
🎉
Rykorra
Rykorra8mo ago
HAHAHAHAHAHAA how does the line end?
JakenVeina
JakenVeina8mo ago
I dunno, what do you want to do with that
Angius
Angius8mo ago
You don't need that last && Unless you want to chain another condition
Rykorra
Rykorra8mo ago
it wasnt actually there that was just intellisense
JakenVeina
JakenVeina8mo ago
you have written a boolean expression that evaluates to true when shipZoneCode is none of the valid values you want why were you writing this expression in the first place?
Rykorra
Rykorra8mo ago
to ensure that a valid zone code was entered
JakenVeina
JakenVeina8mo ago
why do you want to know that?
Rykorra
Rykorra8mo ago
So that the correct price can be used in the cost
JakenVeina
JakenVeina8mo ago
when did we start talking about prices and costs? we were trying to display a message box in particular
if you were going to do it as a single if statement, what would that look like?
you were trying to write an if statement so take that expression and put it in an if statement
Rykorra
Rykorra8mo ago
if (shipZoneCode != "n" && shipZoneCode != "s" && shipZoneCode != "e" && shipZoneCode != "w") { MessageBox.Show("Please Enter a Valid Zone Code."); } IT WORKSSSSSSSSSSSS 🎉 Okay so I am doing the math portion of this now should i make another help post or can we just do it in here?
Angius
Angius8mo ago
Here's fine I think
Rykorra
Rykorra8mo ago
BlazeBin - ijsgxvdsaonh
A tool for sharing your source code with the world!
Rykorra
Rykorra8mo ago
this is what i got so far seems like my costpp is incorrect
Angius
Angius8mo ago
Right, so, what's wrong with your code? Why do you think it's incorrect?
Rykorra
Rykorra8mo ago
seems like it is multiplying 18 * 18
Angius
Angius8mo ago
Only if packWghtTB.Text is "18"
Rykorra
Rykorra8mo ago
oh okay so Cost per pound is working fine and showing the correct value in the string my zone cost is dramatically higher though showing$702
Angius
Angius8mo ago
So, did you mean to do this?
costpp = (18 * costpp);
costN = (18 * costpp) + costN;
costpp = (18 * costpp);
costN = (18 * costpp) + costN;
Assuming user input here for costpp is 10, we're looking at
costpp = 18 * 10
costN = 18 * 18 * 10 + costN
costpp = 18 * 10
costN = 18 * 18 * 10 + costN
Rykorra
Rykorra8mo ago
i need it to take that cost per pound which is 18 * weight entered in package weight tb + the zone cost
Angius
Angius8mo ago
Well that's not what you're doing, then To start with, you set costpp to your packWghtTB
costpp = decimal.Parse(packWghtTB.Text);
costpp = decimal.Parse(packWghtTB.Text);
Rykorra
Rykorra8mo ago
should i make that a var? like i did the shipZoneCode
Angius
Angius8mo ago
Well, yeah, you probably do want to store the weight in a variable
Rykorra
Rykorra8mo ago
okay done
Angius
Angius8mo ago
And now you can do your calculations
Rykorra
Rykorra8mo ago
okay so what do i need to change about those calculations? get rid of the ()
Angius
Angius8mo ago
You can, sure Order of operations will ensure proper order anyway Definitely don't reassign the variables that are, from what I can see, supposed to be constant Like, costE is not supposed to change, is it?
Rykorra
Rykorra8mo ago
no
Angius
Angius8mo ago
I'd even encourage you to declare those variables as actual constant fields
Rykorra
Rykorra8mo ago
this is what I am getting now
Angius
Angius8mo ago
Well, yeah, constants cannot change We already established that we don't want to change those values, right? Same goes for costpp We don't want to reassign that value Rather, you want some new variable named, say total That total would be costpp * weight Then, depending on the zone selected, you would add the zone cost to it
Rykorra
Rykorra8mo ago
? op i forgot to change costpp
Angius
Angius8mo ago
Why so many different costs? Or rather, so many different totals? There will be just one total, no? One result
Rykorra
Rykorra8mo ago
it will display total cost per pound, Total zone cost , and total shipping cost capped at $100
Rykorra
Rykorra8mo ago
this is what my form looks like
Angius
Angius8mo ago
Yeah, it will display totals Based on the selected zone Not totals for each zone So why have totals for each zone?
Rykorra
Rykorra8mo ago
you are right seems wrong okay now my zone cost is showing correctly but my cost per pound is high
Rykorra
Rykorra8mo ago
this is what i have now
Angius
Angius8mo ago
Yeah So, start with totalcost = 18 * costpp That's it Don't reassign to costpp Don't make multiple costs Just one
Angius
Angius8mo ago
Why start with totalcost = 0? decimal totalcost = 18 * costpp is enough Then, since the total cost has to be dependent on the zone...
Angius
Angius8mo ago
you have this part in your code
No description
Angius
Angius8mo ago
Perfect for changing stuff depending on the zone, is it not?
Rykorra
Rykorra8mo ago
so like thise ?
Angius
Angius8mo ago
Yep Then, depending on the zone, add that cost If the zone is n, add costN to totalcost And so on
Rykorra
Rykorra8mo ago
decimal in front right
Angius
Angius8mo ago
Why? You'll be reassigning to the totalcost, right? totalcost += costN for example Or totalcost = totalcost + costN if you're yet unfamiliar with +=
Rykorra
Rykorra8mo ago
?
Angius
Angius8mo ago
Yeah, but you don't want to always do that, do you? Depending on the zone If zone is n you want to add costN If zone is s you want to add costS
MODiX
MODiX8mo ago
Angius
you have this part in your code
From Angius
React with ❌ to remove this embed.
Rykorra
Rykorra8mo ago
I am very confused now haha
Angius
Angius8mo ago
Pseudocode:
cost = costpp * weight

if (zone is n)
cost = cost + costN
if (zone is s)
cost = cost + costS
// etc
cost = costpp * weight

if (zone is n)
cost = cost + costN
if (zone is s)
cost = cost + costS
// etc
Angius
Angius8mo ago
ye
Rykorra
Rykorra8mo ago
so it is still not showing my cost per pound correctly
Angius
Angius8mo ago
How do you display it?
Angius
Angius8mo ago
Well, makes sense totalcost is cost per pund + zone cost Cost per pound is just costpp * weight While the zone cost... depends on the zone So, again, look into those ifs
Rykorra
Rykorra8mo ago
can i get a hint?
Angius
Angius8mo ago
cost = costpp * weight

if (zone is n)
cost = cost + costN
zonecost.text = costN
if (zone is s)
cost = cost + costS
zonecost.text = costS
// etc
cost = costpp * weight

if (zone is n)
cost = cost + costN
zonecost.text = costN
if (zone is s)
cost = cost + costS
zonecost.text = costS
// etc
Angius
Angius8mo ago
👍
Rykorra
Rykorra8mo ago
then delete this right
Angius
Angius8mo ago
Well, the last four lines from here, yes
Rykorra
Rykorra8mo ago
this is what it is showing now I will be back in a little bit I apologize
Angius
Angius8mo ago
Sure Well I'm headed to bed now, so I'll be able to pick it up in some time Perhaps someone else will chip in
WEIRD FLEX
WEIRD FLEX8mo ago
it's over 400 msgs, maybe a recap? :/
M B V R K
M B V R K8mo ago
You could replace that textbox by a Combobox
Accord
Accord8mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.