Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Glen Villar
  Where is Glen Villar?
 Palayan City
 Philippines
 Glen Villar
 To: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 Tags
Subject: RE: if endif,do while,scan endscan with C#
Thread ID: 394070 Message ID: 394186 # Views: 53 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: .NET
Date: Tuesday, December 31, 2013 12:02:34 PM         
   


> >
> > Hi Anand,
> >
> > I think the "While" in C# can also serve as similar to VFP's SCAN/ENDSCAN function.
> > In VFP, I would mostly use scan/endscan if I want to evaluate each record and do something about it. In
> > that case, with C#, the While statement is as effective as well.
> >
> > For instance, I'd like to fill a listview with data and change the color of an entry
> > to red if it has zero cost. So my example below would do such. (pretty much like a scan/endscan) :)
> >
> >
> >             while (DR.Read())
> >                 {
> >                     ListViewItem list = new ListViewItem(DR["prodcode"].ToString());
> >                     list.SubItems.Add(DR["proddesc1"].ToString());
> >                     list.SubItems.Add(DR["initcost"].ToString());
> >                     if (list.SubItems[2].Text == "0.0000")
> >                        {
> >                            list.SubItems[2].ForeColor = System.Drawing.Color.Red;
> >                        }
> >                     lvGoods.Items.AddRange(new ListViewItem[] { list });
> > 
> >                 }
> > 

> >
> >
> >
> >
> > My blog: http://thereportersassistant.blogspot.com
>
> Got blind because of Linq's glorious light didn't even remember this! This is absolutely the one that is closest to scan ... endscan :)
>
>

> Cetin Basoz
>
> Give some sample data in code for your question - here is the tool you need to generate the code
>
> My Blog
>

> MongoDb Certified Developer
> MongoDb Certified DBA
>

> Support Wikipedia

Hi Cetin,

Thanks. I've been reading your article about linq and from other source,
but I haven't had the courage to begin experimenting with linq to sql.
Hopely, in 2014, I could start with it. I really like the idea of
learning something new to me. :)




My blog: http://thereportersassistant.blogspot.com

ENTIRE THREAD

if endif,do while,scan endscan with C# Posted by anand kulkarni @ 12/30/2013 1:30:32 PM
RE: if endif,do while,scan endscan with C# Posted by Stefan Wuebbe @ 12/30/2013 2:15:20 PM
RE: if endif,do while,scan endscan with C# Posted by anand kulkarni @ 12/31/2013 4:20:30 AM
RE: if endif,do while,scan endscan with C# Posted by Cetin Basoz @ 12/30/2013 6:49:50 PM
RE: if endif,do while,scan endscan with C# Posted by Gene Wirchenko @ 12/30/2013 8:11:48 PM
RE: if endif,do while,scan endscan with C# Posted by Stefan Wuebbe @ 12/30/2013 10:52:46 PM
RE: if endif,do while,scan endscan with C# Posted by Gene Wirchenko @ 12/31/2013 7:34:32 PM
RE: if endif,do while,scan endscan with C# Posted by Tony Vignone @ 12/31/2013 9:26:15 PM
RE: if endif,do while,scan endscan with C# Posted by David Mustakim @ 12/31/2013 9:39:31 PM
RE: if endif,do while,scan endscan with C# Posted by Tony Vignone @ 12/31/2013 10:33:36 PM
RE: if endif,do while,scan endscan with C# Posted by David Mustakim @ 1/2/2014 10:05:03 PM
RE: if endif,do while,scan endscan with C# Posted by Tony Vignone @ 1/2/2014 11:37:33 PM
RE: if endif,do while,scan endscan with C# Posted by Gene Wirchenko @ 12/31/2013 11:06:05 PM
RE: if endif,do while,scan endscan with C# Posted by Cetin Basoz @ 1/2/2014 1:42:16 PM
RE: if endif,do while,scan endscan with C# Posted by Gene Wirchenko @ 1/2/2014 6:49:34 PM
RE: if endif,do while,scan endscan with C# Posted by Stefan Wuebbe @ 1/1/2014 11:49:33 AM
RE: if endif,do while,scan endscan with C# Posted by Gene Wirchenko @ 1/2/2014 3:31:21 AM
RE: if endif,do while,scan endscan with C# Posted by Cetin Basoz @ 1/2/2014 1:38:05 PM
RE: if endif,do while,scan endscan with C# Posted by Gene Wirchenko @ 1/2/2014 7:04:59 PM
RE: if endif,do while,scan endscan with C# Posted by Cetin Basoz @ 1/2/2014 7:31:59 PM
RE: if endif,do while,scan endscan with C# Posted by Gene Wirchenko @ 1/3/2014 7:45:08 PM
RE: if endif,do while,scan endscan with C# Posted by Cetin Basoz @ 1/3/2014 9:38:13 PM
RE: if endif,do while,scan endscan with C# Posted by Gene Wirchenko @ 1/6/2014 8:26:53 PM
RE: if endif,do while,scan endscan with C# Posted by Glen Villar @ 12/31/2013 4:19:58 AM
RE: if endif,do while,scan endscan with C# Posted by Cetin Basoz @ 12/31/2013 10:10:22 AM
RE: if endif,do while,scan endscan with C# Posted by Glen Villar @ 12/31/2013 12:02:34 PM
RE: if endif,do while,scan endscan with C# Posted by Binod Binani @ 1/3/2014 2:34:45 PM