[fpc-pascal] Using Pointer : In Free pascal

Tomas Hajny XHajT03 at hajny.biz
Mon Jul 7 10:14:53 CEST 2014


On Mon, July 7, 2014 09:22, mokashe.ram wrote:


Hi Sud,

>         I am using a pointer as shown below
>
>         Locat_Pointer= ^ Locate
>         Locate= Record
>                  next:locat_pointer;
>                   Code:word;
>
>        How to assign USer input to pointer variable run time in free
> pascal
> Like Below
>        Locate_Pointer^.code:=.....?

If you ask about conversion of the input read using ReadLn into a string
variable to the word variable, then one option would be using procedure
System.Val (see http://www.freepascal.org/docs.var -> "Run-Time Library
(RTL) units reference manual" -> "System" -> "StringFunctions" -> "Val").

Tomas





More information about the fpc-pascal mailing list