;Ask a string and reserve memory for a string. Add another string to the string.
;Print the new string

		include	"baselibs.i"
		include	"baselibs1.i"
		include	"string.i"

		#define	LF,10

		variables

		array	char,string,40
		array	char,letter,40

	main()

	CPTR	>string
	CPTR	>letter
	CPTR	>memstring
	int	size
	{
		pointer	>string,=&,string	;address to pointer
		pointer	>letter,=&,letter

		print	<"give astring ">
		func	size,=,getchar(),>string		;don't give more than 39 characters
			if	size,!=,0,1		;don't if zero
			{
				func	>memstring,=,allocmem,80,1		;get memory
				if	>memstring,!=,0,2
				{
					strcpy	>memstring,>string		;copy string to memory
					strcpy	>letter,>memstring
					strcat	>memstring,>string	;add string to memstring
					print	<" ",LF>
					printf	<"remove a string %s size %ld ",LF>,>memstring,size
					}
					ifend	2

				freemem	>memstring,40

			}
			ifend	1

		print	>string
		print	<"remove a string",LF>
		printf	<" %s  lenght of a string %ld ">,>letter,size		;print a string from memory		

	}
	
	end

