Learn R Programming

RProtoBuf (version 0.1-0)

clear-methods: Clear a field or all fields of the message and set them to their default values

Description

Clear one field or all fields of the message and set them to their default values

Arguments

Examples

Run this code
message <- new( tutorial.Person, name = "dddd", email = "eeeeeee", id = 1 )
	writeLines( as.character( message ) )
	clear( message )
	# clear works also as a pseudo method :
	message$clear() 
	
	writeLines( as.character( message ) )
	
	# clear single fields
	message <- new( tutorial.Person, name = "dddd", email = "eeeeeee", id = 1 )
	message$clear( "name" )
	writeLines( as.character( message ) )

Run the code above in your browser using DataLab