OpenVMS Source-Code Demos

basic_calling_c_demo4_part1

1000	!=================================================================================================
	! title  : basic_calling_c_demo4_part1.bas
	! author : Neil Rieck	(http://neilrieck.net) (mailto:n.rieck@sympatico.ca)
	! what   : passing string data from BASIC to C (and back again)
	! build  : bas  basic_calling_c_demo4_part1
	!	 : cc   basic_calling_c_demo4_part2
	!	 : link /exc=basic_calling_c_demo4.exe	-
	!		basic_calling_c_demo4_part1,	-
	!		basic_calling_c_demo4_part2
	! history:
	! ver who when   what
	! --- --- ------ ---------------------------------------------------------------------------------
	! 100 NSR 151209 original effort
	!=================================================================================================
	option type=explicit							!
	declare string constant k_program = "basic_calling_c_demo4_part1"
	!
	external long function basic_calling_c_demo_c1(string by desc)
	!
	!	global variables (BASIC only)
	!
	declare string	gMain$				,	&
		long	rc
	!=======================================================
	!	main
	!=======================================================
	main:
	print "-i-program: "+k_program 				!
	gMain$		= "hello there"				! init variables
	!
	print "-i-gMain$ = "; gMain$				!
	print "-i-calling function c1"				!
	rc = basic_calling_c_demo_c1(gMain$)			!
	!
	print "-i-back in: "+k_program				!
	print "-i-rc:";rc					!
	print "-i-gMain$ = "; gMain$				!
	!
	print "-i-exiting: "+k_program				!
	end program (1)						! VMS-s-

Back to OpenVMS
Back to OpenVMS Demo Index
Back to Home
Neil Rieck
Kitchener - Waterloo - Cambridge, Ontario, Canada.