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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.