/*  This script will put address into the address book */

address 'ontheball'
options results

tag=''
done=FALSE

do while done=FALSE
	parse pull tag
	tag=putreturn(tag)
	if left(tag,1)='-' then done=TRUE
	else do
		say AddTag tag
		'AddTag'tag
	end
end

address=''
done=FALSE

do while done=FALSE
	parse pull address
	address=putreturn(address)
	if left(address,1)='-' then done=TRUE
	else do
		say AddAddress address
		'AddAddress'address
	end
end

app=''
done=FALSE

do while done=FALSE
	parse pull app
	app=putreturn(app)
	if left(app,1)='-' then done=TRUE
	else do
		say AddApp app
		'AddApp'app
	end
end

todo=''
done=FALSE

do while done=FALSE
	parse pull todo
	todo=putreturn(todo)
	if left(todo,1)='-' then done=TRUE
	else do
		say AddToDo todo
		'AddToDo'todo
	end
end

exit

putreturn:
parse arg st
do i=1 to length(st)
	if substr(st,i,4)='\|\\' then do
		temp=left(st,i-1) || d2c(10) || right(st,length(st)-i-3)
		st=temp
	end
end

return st
