xcas coding option without *end*

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 557
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

xcas coding option without *end*

Message par compsystems » mer. févr. 27, 2019 2:32 pm

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

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: xcas coding option without *end*

Message par parisse » jeu. févr. 28, 2019 6:48 am

I think it's much better to have an explicit end, I don't like implicit bloc end with indentation.

Répondre