Skip to main content
added 4 characters in body
Source Link
Kai Burghardt
  • 1.1k
  • 1
  • 6
  • 13

use string as an array[1‥n] of 0‥ord(maxChar)

use string as an array[1‥n] of 0‥ord(maxChar)

In Pascal string literals may contain arbitrary values from the domain of char. Even chr(0) is permitted. The only illegal component is the value denoting a newline (in ASCII chr(10) [“line feed”] and/or chr(13) [“carriage return”]). In other words, multi-line string literals are not allowed. Furthermore the string delimiting character ' (ASCII chr(39)) needs to be escaped (conventionally ''). Example:

program stringArrayDemo(output);
begin
    writeLn(ord(('€Bÿ')[3]))
end.

Since it’s not properly displayed, the above string literal consists of the following four characters (ordinal value in hexadecimal base):

80 42 FF 12

Therefore the above program will print 255 as it’s the third character’s ordinal value. Obviously in your challenge at hand the constant index 3 will be some variable expression and the string literal will have different values.

Since the maxChar value introduced in ISO standard 10206 “Extended Pascal” documents an implementation characteristic, it is imperative that your solution mentions the processor used. The above program will work adequately if compiled with the GNU Pascal Compiler (GPC) or the Free Pascal Compiler (FPC).

use string as an array[1‥n] of 0‥ord(maxChar)

In Pascal string literals may contain arbitrary values from the domain of char. Even chr(0) is permitted. The only illegal component is the value denoting a newline (in ASCII chr(10) [“line feed”] and/or chr(13) [“carriage return”]). In other words, multi-line string literals are not allowed. Furthermore the string delimiting character ' (ASCII chr(39)) needs to be escaped (conventionally ''). Example:

program stringArrayDemo(output);
begin
    writeLn(ord(('€Bÿ')[3]))
end.

Since it’s not properly displayed, the above string literal consists of the following four characters (ordinal value in hexadecimal base):

80 42 FF 12

Therefore the above program will print 255 as it’s the third character’s ordinal value. Obviously in your challenge at hand the constant index 3 will be some variable expression and the string literal will have different values.

Since the maxChar value introduced in ISO standard 10206 “Extended Pascal” documents an implementation characteristic, it is imperative that your solution mentions the processor used. The above program will work adequately if compiled with the GNU Pascal Compiler (GPC) or the Free Pascal Compiler (FPC).

use string as an array[1‥n] of 0‥ord(maxChar)

In Pascal string literals may contain arbitrary values from the domain of char. Even chr(0) is permitted. The only illegal component is the value denoting a newline (in ASCII chr(10) [“line feed”] and/or chr(13) [“carriage return”]). In other words, multi-line string literals are not allowed. Furthermore the string delimiting character ' (ASCII chr(39)) needs to be escaped (conventionally ''). Example:

program stringArrayDemo(output);
begin
    writeLn(ord(('€Bÿ')[3]))
end.

Since it’s not properly displayed, the above string literal consists of the following four characters (ordinal value in hexadecimal base):

80 42 FF 12

Therefore the above program will print 255 as it’s the third character’s ordinal value. Obviously in your challenge at hand the constant index 3 will be some variable expression and the string literal will have different values.

Since the maxChar value introduced in ISO standard 10206 “Extended Pascal” documents an implementation characteristic, it is imperative that your solution mentions the processor used. The above program will work adequately if compiled with the GNU Pascal Compiler (GPC) or the Free Pascal Compiler (FPC).

added 5 characters in body
Source Link
Kai Burghardt
  • 1.1k
  • 1
  • 6
  • 13

use string as an array[1‥n] of 0‥ord(maxChar)

In Pascal string literals may contain arbitrary values from the domain of char. Even chr(0) is permitted. The only illegal component is the value denoting a newline (in ASCII chr(10) [“line feed”] and/or chr(13) [“carriage return”]). In other words, multi-line string literals are not allowed. Furthermore the string delimiting character ' (ASCII chr(39)) needs to be escaped (conventionally ''). Example:

program stringArrayDemo(output);
begin
    writeLn(ord(('€Bÿ')[3]))
end.

Since it’s not properly displayed, the above string literal consists of the following four characters (ordinal value in hexadecimal base):

80 42 FF 12

Therefore the above program will print 255 as it’s the third character’s ordinal value. Obviously in your challenge at hand the constant index 3 will be some variable expression and the string literal will have different values.

Since the maxChar value introduced in ISO standard 10206 “Extended Pascal” documents an implementation characteristic, it is imperative that your solution mentions the processor used. The above program will work adequately if compiled with the GNU Pascal Compiler (GPC) or the Free Pascal Compiler (FPC).

use string as an array[1‥n] of 0‥ord(maxChar)

In Pascal string literals may contain arbitrary values from the domain of char. Even chr(0) is permitted. The only illegal component is the value denoting a newline (in ASCII chr(10) [“line feed”] and/or chr(13) [“carriage return”]). In other words, multi-line string literals are not allowed. Furthermore the string delimiting character ' (ASCII chr(39)) needs to be escaped (conventionally ''). Example:

program stringArrayDemo(output);
begin
    writeLn(ord(('€Bÿ')[3]))
end.

Since it’s not properly displayed, the above string literal consists of the following characters (ordinal value in hexadecimal base):

80 42 FF 12

Therefore the above program will print 255 as it’s the third character’s ordinal value. Obviously in your challenge at hand the constant index 3 will be some variable expression and the string literal will have different values.

Since the maxChar value introduced in ISO standard 10206 “Extended Pascal” documents an implementation characteristic, it is imperative that your solution mentions the processor used. The above program will work adequately if compiled with the GNU Pascal Compiler (GPC) or the Free Pascal Compiler (FPC).

use string as an array[1‥n] of 0‥ord(maxChar)

In Pascal string literals may contain arbitrary values from the domain of char. Even chr(0) is permitted. The only illegal component is the value denoting a newline (in ASCII chr(10) [“line feed”] and/or chr(13) [“carriage return”]). In other words, multi-line string literals are not allowed. Furthermore the string delimiting character ' (ASCII chr(39)) needs to be escaped (conventionally ''). Example:

program stringArrayDemo(output);
begin
    writeLn(ord(('€Bÿ')[3]))
end.

Since it’s not properly displayed, the above string literal consists of the following four characters (ordinal value in hexadecimal base):

80 42 FF 12

Therefore the above program will print 255 as it’s the third character’s ordinal value. Obviously in your challenge at hand the constant index 3 will be some variable expression and the string literal will have different values.

Since the maxChar value introduced in ISO standard 10206 “Extended Pascal” documents an implementation characteristic, it is imperative that your solution mentions the processor used. The above program will work adequately if compiled with the GNU Pascal Compiler (GPC) or the Free Pascal Compiler (FPC).

added 150 characters in body
Source Link
Kai Burghardt
  • 1.1k
  • 1
  • 6
  • 13

use string as an array[1‥n] of 0‥ord(maxChar)

In Pascal string literals may contain arbitrary values from the domain of char. Even chr(0) is permitted. The only illegal component is the value denoting a newline (in ASCII chr(10) [“line feed”] and/or chr(13) [“carriage return”]). In other words, multi-line string literals are not allowed. Furthermore the string delimiting character ' (ASCII chr(39)) needs to be escaped (conventionally ''). Example:

program stringArrayDemo(output);
begin
    writeLn(ord(('€Bÿ')[3]))
end.

Since it’s not properly displayed, the above string literal consists of the following characters (ordinal value in hexadecimal base):

80 42 FF 12

Therefore the above program will print 255 as it’s the third character’s ordinal value. SinceObviously in your challenge at hand the constant index 3 will be some variable expression and the string literal will have different values.

Since the maxChar value introduced in ISO standard 10206 “Extended Pascal” documents an implementation characteristic, it is imperative that your solution mentions the processor used. The above program will work adequately if compiled with the GNU Pascal Compiler (GPC) or the Free Pascal Compiler (FPC).

use string as an array[1‥n] of 0‥ord(maxChar)

In Pascal string literals may contain arbitrary values from the domain of char. Even chr(0) is permitted. The only illegal component is the value denoting a newline (in ASCII chr(10) [“line feed”] and/or chr(13) [“carriage return”]). In other words, multi-line string literals are not allowed. Furthermore the string delimiting character ' (ASCII chr(39)) needs to be escaped (conventionally ''). Example:

program stringArrayDemo(output);
begin
    writeLn(ord(('€Bÿ')[3]))
end.

Since it’s not properly displayed, the above string literal consists of the following characters (ordinal value in hexadecimal base):

80 42 FF 12

Therefore the above program will print 255 as it’s the third character’s ordinal value. Since the maxChar value introduced in ISO standard 10206 “Extended Pascal” documents an implementation characteristic, it is imperative that your solution mentions the processor used. The above program will work adequately if compiled with the GNU Pascal Compiler (GPC) or the Free Pascal Compiler (FPC).

use string as an array[1‥n] of 0‥ord(maxChar)

In Pascal string literals may contain arbitrary values from the domain of char. Even chr(0) is permitted. The only illegal component is the value denoting a newline (in ASCII chr(10) [“line feed”] and/or chr(13) [“carriage return”]). In other words, multi-line string literals are not allowed. Furthermore the string delimiting character ' (ASCII chr(39)) needs to be escaped (conventionally ''). Example:

program stringArrayDemo(output);
begin
    writeLn(ord(('€Bÿ')[3]))
end.

Since it’s not properly displayed, the above string literal consists of the following characters (ordinal value in hexadecimal base):

80 42 FF 12

Therefore the above program will print 255 as it’s the third character’s ordinal value. Obviously in your challenge at hand the constant index 3 will be some variable expression and the string literal will have different values.

Since the maxChar value introduced in ISO standard 10206 “Extended Pascal” documents an implementation characteristic, it is imperative that your solution mentions the processor used. The above program will work adequately if compiled with the GNU Pascal Compiler (GPC) or the Free Pascal Compiler (FPC).

Source Link
Kai Burghardt
  • 1.1k
  • 1
  • 6
  • 13
Loading