Yeah I know from my code, which often is just bs project, that with nesting lotsa crap
it's a lot easier to follow the Original Method of:
for($i=0;$i<count($file);$i++){
$file2 = split("[:]+",$file[$i]);
for($j=0;$j<count($file2);$j++){
if(!$file2($j)) {
echo "Value is Null for line $i subset $j\n";
} else {
echo "Value is $file2[$j] for line $i subset $j\n";
}
echo "Completed line reads.\n";
}
echo "File complete.\n";
}
--
On Fri, 12 Apr 2002 03:06:22
Jason Wong wrote:
>On Friday 12 April 2002 02:50, Kevin Stone wrote:
>
>> On the other hand the Inline Method is clean. You can see at a glance
>> where each block begins ends. But it is not compact. It spreads the code
>> out over many lines. I recommend this method for modern programmers coding
>> on large screens. Besides that I think it's just a better way to code.
>> More whitespace = less confusion = faster debugs.
>>
>> /**** INLINE METHOD *****/
>> foreach ($mylist as $key => $val)
>> {
>> if ($key == $list_num)
>> {
>> for ($i=0; $i<count($key); $i++)
>> {
>> record_list($key[$i]);
>> }
>> }
>> elseif ($key == $skip_val)
>> {
>> continue;
>> }
>> else
>> {
>> echo "INVALID ENTRY: "$key ." at ". $val . "\n";
>> }
>> }
>> /************************/
>
>
>I prefer this style because I know exactly where my if statement ends,
>especially if you have a humungous nested if-elseif-else construct.
>
>
>foreach ($mylist as $key => $val) {
> if ($key == $list_num) {
> for ($i=0; $i<count($key); $i++) {
> record_list($key[$i]);
> }}
> elseif ($key == $skip_val) {
> continue; }
> else {
> echo "INVALID ENTRY: "$key ." at ". $val . "\n";
> }
>}
>
>
>--
>Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>Open Source Software Systems Integrators
>* Web Design & Hosting * Internet & Intranet Applications Development *
>
>/*
>Weiler's Law:
> Nothing is impossible for the man who doesn't have to do it himself.
>*/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
See Dave Matthews Band live or win a signed guitar
http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_020201/splash.asp
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php