Board index » delphi » How do you declare a constant set?

How do you declare a constant set?

That the simple question.. im thought it would be easy.. but no..

i know an array is like
 ARRAYNAME: array[1..X] of byte = (2,3,4,..,9,10);

im writing a program that manages data.. and the save option.. i let them
chose name but i need a set of valid chars so i had

VALIDFILENAMECHARS: set of char =
('a','b',..'Y','Z','~','!','@','$','#','%','^','&');
then it wouldnt let me have quote around the things..
no that wont work

then
i thought well maybe the compiler is thinking CHARS : set of char {=asdfsdf}
and that invalid.. it was think set of all char..
nope..

then i thought
CHARS = instead of :
as in
 CHARS = set of ('a'..'z','A'..'Z',other chars);

nope still no luck

anyway how do i do this??

 

Re:How do you declare a constant set?


Quote
"warmaster" <r...@bitstorm.net> wrote:

>VALIDFILENAMECHARS: set of char =
>('a','b',..'Y','Z','~','!','@','$','#','%','^','&');
>then it wouldnt let me have quote around the things..
>no that wont work

Use [] instead of ().

Jud McCranie

Re:How do you declare a constant set?


hhmmm sounds like it might work.. i hope it does..

Quote
Jud McCranie <jud.mccra...@mindspring.com> wrote in message

news:728r5s8ta3g9lum6jgti3228fjaou39tvu@4ax.com...
Quote
> "warmaster" <r...@bitstorm.net> wrote:

> >VALIDFILENAMECHARS: set of char =
> >('a','b',..'Y','Z','~','!','@','$','#','%','^','&');
> >then it wouldnt let me have quote around the things..
> >no that wont work

> Use [] instead of ().

> Jud McCranie

Other Threads