Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Ok, here's my question. I'm sure it's got a relatively easy answer, but I'm not sure how to approach this.

I've set up a TK Form that tracks different parts and various statistics about those parts (quantity on hand, part #, orders for that part, supplier, etc.). I'm trying to set up a daily update form that just displays a form with a basic "part number" : "Quantity" entry box, with the current quantity inserted into the entry as a starting value.

@partnames is an array I populate with all the parts I'm currently tracking, @quantity has the quantities.
Here's my code:

foreach (@partnames) { $j++; } for ($i=0; $i < $j; $i++) { $xv = $leftframe->Frame()->pack; $v = $xv->Label(-text => "$partnames[$i]", -justify => 'right' +)->pack(-side => 'right'); $w = $rightframe->Entry(-width => '5', -background => 'White') +->pack; $w -> insert('end', $quantity[$i]); }
Now, this comes out how I want it, an entry and label for each part, with it's quantity entered as a starting value.

Now, the user will go through the paperwork, and update the quantities for each part.

I know how to use a simple $variable = $entry->get statement, but in this case, each entry is named $w. How do I pull the numbers in the entry into an array so I can spit them back into the database I have set up?

Thank you for your help.

In reply to Newbie Tk Data collection Question by bblustein

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-24 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found