UBB.Dev
Posted By: Slurpee Variable question...pulling from an array - 04/04/2001 11:50 PM
Ok I know I am being stupid. I want to pull the topic start time and date to use in the thread pages. I had no problem reversing the topic lines to get the last post, but can't figure out how to call the FIRST line. The $stat_line doesn't give time and dates, just the amount of replies, the topic starter. I need to pull the time and date from the first reply line, but can only seem to reverse it.
$reversedpostarray[(@#reversedpostarray)-1] SHOULD be the first Z line in the thread, thus the first post. If not, then it's -2.

[ April 04, 2001: Message edited by: Charles Capps ]
Posted By: Slurpee Re: Variable question...pulling from an array - 04/05/2001 12:35 AM
Charles, how do I call the freaking thing, I keep getting syntax errors because of the #.
Try $# rather than @#.
Posted By: Slurpee Re: Variable question...pulling from an array - 04/05/2001 4:08 AM
CC - Tried that still no luck. Here's the code I am using, is this totally wrong, it has to be.

# get topic message
@firstpost = split(/||/, $reversedpostarray[($#reversedpostarray)-1]);
$fp_time = $firstpost[3];
I assume you're actually using the real array name, not reversedpostarray. wink

Okay...

my $counter = 0;
foreach(@reversedpostarray) { last if =~ /^Z||000000||/; $counter++; }

$reversedpostarray[$counter] is the first Z line, post 000000.
Posted By: Slurpee Re: Variable question...pulling from an array - 04/05/2001 6:45 AM
Yes I was using the actual array name I just posted that real fast as an example. Thanks man, that clears it up A LOT. smile
Posted By: Slurpee Re: Variable question...pulling from an array - 04/05/2001 7:18 AM
Man I give up on this, another damn syntax error.
© UBB.Developers