0

Alrighty, I have two questions to ask:

1. Is there a length function in Dev Pascal ? If so, what is it? If not, is there a way to achieve the length of a string?

2. Can you change a string into an integer and/or vice versa. (example: entering '123' as a string and turning it into the number 123.)


Any assistance would be greatly appreciated. Thank you in advance.

Cheers,


Shane

2
Contributors
1
Reply
2
Views
12 Years
Discussion Span
Last Post by Jackrabbit
0

1. Is there a length function in Dev Pascal ? If so, what is it? If not, is there a way to achieve the length of a string?

Dev Pascal uses either the Free Pascal compiler or the GNU Pascal compiler.

Online documentation for FPC System unit:

length: Length returns the length of the string S , which is limited to 255 for shortstrings. If the strings S is empty, 0 is returned. Note: The length of the string S is stored in S[0] for shortstrings only. The Length fuction should always be used on ansistrings and widestrings.

2. Can you change a string into an integer and/or vice versa. (example: entering '123' as a string and turning it into the number 123.)

StrToInt( S : String ): StrToInt will convert the string S to an integer. If the string contains invalid characters or has an invalid format, then an EConvertError is raised.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.