Page 1 sur 1

xcas coding option without *end*

Publié : mer. févr. 27, 2019 2:32 pm
par compsystems
Hello BP

incorporate the idea of python in the codification, to eliminate the end/end_

current

Code : Tout sélectionner

function AgeVote( )
	local Age; 

	ClrIO 

	printf( "How old are you?" )
	input( Age )

	if Age ≥ 18 then
		printf(  "Go vote!" )
	else
		printf( "Sorry, not yet" )
	end_if

	return Done

ffunction

option without *end*

Code : Tout sélectionner

function AgeVote( )
	local Age; 

	ClrIO 

	printf( "How old are you?" )
	input( Age )

	if Age ≥ 18 then
		printf(  "Go vote!" )
	else
		printf( "Sorry, not yet" )

	return Done

ffunction

Re: xcas coding option without *end*

Publié : jeu. févr. 28, 2019 6:48 am
par parisse
I think it's much better to have an explicit end, I don't like implicit bloc end with indentation.