one part of a script that I wrote has to output information from a database in a nicely formatted table, that looks different depending on the data that is to be displayed. I have no problem doing this, & it works fine. Here's the problem though. I have a main menu, and when the user selects the option to output the data to the screen it calls a subroutine that does that. The first time it runs, it works perfectly, then returns them to the main menu. if they run the subroutine again though, the output it messed up.
For example, the FORMATHANDLE_TOP isn't displayed the second time, and other things like that. Any ideas?
All the variables used in the subroutine are local (I think... I initialized all of them within the brackets of a "my" function)
here is some "sample" (i've edited it, made it thinner, cut it down, etc) output:
For example, the FORMATHANDLE_TOP isn't displayed the second time, and other things like that. Any ideas?
All the variables used in the subroutine are local (I think... I initialized all of them within the brackets of a "my" function)
here is some "sample" (i've edited it, made it thinner, cut it down, etc) output:
Code:
##################################
INSERT MAIN MENU STUFF HERE....
call the subroutine:
##################################
-=DATA=-
Name Side Room# | Target Name Side Room#
--------------------------+-------------------------
Bernie Walker B 323 | biggie steve B 125
Billy Bob B 124 | Jimmie rims B 036
Chris Nasher A 135 | silly Heade B 222
Greg Somethin B 352 | billy bob A 324
test name A 323 | need more B 325
chad buthead B 232 | Super Man B 324
hot potato B 823 | jason mohawk A 082
Press Enter to continue . . .
mark delaney B 337 | Someone Else A 126
need more B 325 | hulo gorge A 323
steve long B 036 | need a name A 489
Press Enter to return to the main menu...
##################################
INSERT MAIN MENU STUFF HERE....
recall the subroutine:
##################################
Bernie Walker B 323 | biggie steve B 125
Billy Bob B 124 | Jimmie rims B 036
Chris Nasher A 135 | silly Heade B 222
Greg Somethin B 352 | billy bob A 324
test name A 323 | need more B 325
chad buthead B 232 | Super Man B 324
hot potato B 823 | jason mohawk A 082
Press Enter to continue . . .
mark delaney B 337 | Someone Else A 126
need more B 325 | hulo gorge A 323
steve long B 036 | need a name A 489
B | B
B | B
B | B
B | B
B | B
B | B
B | B
Š
-=DATA=-
Name Side Room# | Target Name Side Room#
--------------------------+-------------------------
B | B
B | B
B | B
B | B
B | B
Press Enter to continue . . .
#####################################
Here it scrolls lines and lines of (separated by prompts every 20 lines):
B | B
occasionally throwing in a:
-=DATA=-
Name Side Room# | Target Name Side Room#
--------------------------+-------------------------
#######################################