[…] But it is safe to do that ?To quote from the ISO standard 7185 (“Standard Pascal”):
6.4.2.2 Required simple-typesThat’s all fine, but the compiler still needs to claim ISO-compliance. Bottom line, your algorithm is “safe”, i. e. produces the expected result, as long as ord('A') + 25 = ord('Z').
The following types shall exist
- integer-type. […]
- real-type. […]
- Boolean-type. […]
- char-type. […] The following relations shall hold.
- The subset of character values representing the digits 0 to 9 shall be numerically ordered and contiguous.
- The subset of character values representing the upper case letters A to Z, if available, shall be alphabetically ordered but not necessarily contiguous.
- The subset of character values representing the lower case letters a to z, if available, shall be alphabetically ordered but not necessarily contiguous.
Note that the ISO standard doesn't declare that there are 26 characters in the range A through Z.Well, if your comment is meant to say it could be less than 26 characters:
4 Definitional conventionsBecause you can write, compose, say, identifiers as a sequence of letters A – Z, you can specify these letters in a character-string, too.
[…]
The characters required to form Pascal programs shall be those implicitly required to form the tokens and separators defined in 6.1.
[…]
6.1.1 General
[…] The representation of any letter (upper case or lower case, differences in font (https://xkcd.com/2309/), etc.) occurring anywhere outside of a character-string (see 6.1.7) shall be insignificant in that occurrence to the meaning of the program.
- letter = ‘a’ | ‘b’ | ‘c’ | ‘d’ | […] ‘w’ | ‘x’ | ‘y’ | ‘z’ .
[…] By the way, the goal is to get all the devices on a Windows system with something like this: […]Maybe it won’t catch unformatted devices, I don’t know.
[…] By the way, the goal is to get all the devices on a Windows system with something like this: […]Maybe it won’t catch unformatted devices, I don’t know.
By the way, the goal is to get all the devices on a Windows system with something like this:I haved a DriveComboBox for that...
4 Definitional conventions
[…]
The characters required to form Pascal programs shall be those implicitly required to form the tokens and separators defined in 6.1.
6.4.2.2 Required simple-types
By the way, the goal is to get all the devices on a Windows system with something like this:
@Jorge3000 and @ASerge and @Bart: many thanks for that execellent options.
But I forgot to note that I prefer a cross-os code and not use window unit .
So I will stay with one of the options using a loop with if directoryexists((achar + ':\') in it.
Fre;D
Which in itself is not cross OS.
@Jorge3000 and @ASerge and @Bart: many thanks for that execellent options.
But I forgot to note that I prefer a cross-os code and not use window unit .
So I will stay with one of the options using a loop with if directoryexists((achar + ':\') in it.
Fre;D
Which in itself is not cross OS.
@Jorge3000 and @ASerge and @Bart: many thanks for that execellent options.
But I forgot to note that I prefer a cross-os code and not use window unit .
So I will stay with one of the options using a loop with if directoryexists((achar + ':\') in it.
Fre;D
Which in itself is not cross OS.