🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #186

Converting from Delphi (sets and streams)

#186
From: Marko Binic
Date: Sun, 29 Oct 2006 10:45
22 lines
1661 bytes
Hi guys,
 I'm trying to convert a personal app from Delphi to C# but I'm having some
trouble finding a C# equivalent for sets. I've been paging through all C#
books I have here and just can't find it. What I want to do is declare a set
of f.ex. characters:

  const WhiteSpace = [#32, #10, #13, #9];

and check memership like this:

  if c in WhiteSpace then...

but I don't know how, using arrays is an alternative, but I need something
faster and easier to play with. Any ideas?

 Another problem I'm having is reading from a stream (System.IO.FileStream).
The BeginRead method takes a byte array, but I need to read words (2 bytes)
in order to compare some values, so is there something like BlockRead from
Delphi?

Regards
Marko
Technical Details
Message-ID: <45448666@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,228682803dcaeb60,start
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Marko Binic" <marko_binic@yahoo.com>
Newsgroups: borland.public.csharpbuilder.language.csharp
Subject: Converting from Delphi (sets and streams)
Date: Sun, 29 Oct 2006 11:45:51 +0100
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
NNTP-Posting-Host: 213.137.121.77
Message-ID: <45448666@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1162118758 213.137.121.77 (29 Oct 2006 02:45:58 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail