Re: [nodejs] need help with sub routine callback with for loop

2012-07-17 Thread Ray Manullang
can you help me to make script delivery mail, with node js, please help me.. ? inside wiget : from : to : Weight : Sumbit.. help me please thanks -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this

Re: [nodejs] need help with sub routine callback with for loop

2012-07-17 Thread john.tiger
thanks for helpful code and not commentary - actually had tried something like that but messed the count up - happens when low on sleep and high on frustration. advice on lib noted. On 07/16/2012 08:19 PM, Marak Squires wrote: var staff = ["bill","mary"]; var total = []; var cou

Re: [nodejs] need help with sub routine callback with for loop

2012-07-16 Thread Rick Waldron
Dammit Marak, you blitzed me ;P -Rick On Monday, July 16, 2012 at 10:21 PM, Marak Squires wrote: > Err. > > Remove count = staff.length; > > and like I said, use the async lib. > On Mon, Jul 16, 2012 at 7:19 PM, Marak Squires (mailto:marak.squi...@gmail.com)> wrote: > > > > > var staff =

Re: [nodejs] need help with sub routine callback with for loop

2012-07-16 Thread Marak Squires
Err. Remove *count = staff.length;* and like I said, use the async lib. On Mon, Jul 16, 2012 at 7:19 PM, Marak Squires wrote: > > var staff = ["bill","mary"]; >> var total = []; >> var count = 0; >> get_total_list(staff, function(err, callback) { >> count = staff.length; >> >> for (var i=0;

Re: [nodejs] need help with sub routine callback with for loop

2012-07-16 Thread Marak Squires
> var staff = ["bill","mary"]; > var total = []; > var count = 0; > get_total_list(staff, function(err, callback) { > count = staff.length; > for (var i=0; i get_staff_children(staff[i], function(err, cb) { > total.push(cb); > count++; > if(count === staff.length) { >

Re: [nodejs] need help with sub routine callback with for loop

2012-07-16 Thread Martin Wawrusch
With all due respect, this library is one of the most used in the whole node.js ecosystem and is definitely simpler to use then rolling your own, AND testing it. On Mon, Jul 16, 2012 at 7:15 PM, john.tiger wrote: > On 07/16/2012 07:41 PM, Martin Wawrusch wrote: > > This should help: > > https:/

Re: [nodejs] need help with sub routine callback with for loop

2012-07-16 Thread john.tiger
On 07/16/2012 07:41 PM, Martin Wawrusch wrote: This should help: https://github.com/caolan/async honestly, we are having enough trouble with additional libraries - we just want a simple solution with node code On Mon, Jul 16, 2012 at 5:55 PM, john.tiger mailto:john.tigernas...@gmail.com

Re: [nodejs] need help with sub routine callback with for loop

2012-07-16 Thread Mark Hahn
> stuck in async hell Well, maybe async beginner's hell. You do know that the inner loop will complete before the first callback to cb, right? You need to study some node tutorials. On Mon, Jul 16, 2012 at 6:41 PM, Martin Wawrusch wrote: > This should help: > > https://github.com/caolan/async

Re: [nodejs] need help with sub routine callback with for loop

2012-07-16 Thread Martin Wawrusch
This should help: https://github.com/caolan/async On Mon, Jul 16, 2012 at 5:55 PM, john.tiger wrote: > stuck in async hell - page displaying (with null) before going thru full > loop and returning total with data - probably some simple funct wrap but > can't see it - thks for any help > > var s

[nodejs] need help with sub routine callback with for loop

2012-07-16 Thread john.tiger
stuck in async hell - page displaying (with null) before going thru full loop and returning total with data - probably some simple funct wrap but can't see it - thks for any help var staff = ["bill","mary"]; var total = []; get_total_list(staff, function(err, callback) { for (var i=0; i [] -