Man, thats annoying. The tags didn't work. Let me repost and try again.
Thats a very basic question I'm afraid. I say this because even I, muggins extraordinarie, can answer it. I'd suggest you buy "the Beginners Guide to DarkBasic Game Programming" and read that. Alternatively, have a look at Marc Fleury's website. Its not complete, but you'd find it useful.
Anyway, to address your question, you need to define yourself a health variable. This could be, say:
health = 100
That'd be your maximum health assuming your character starts at maximum health at the beginning of the game.
Then during the game you could reduce it when your character is hit by an enemy and damaged, i.e.
if (hit = 1) AND (health > damage)
health = health - damage
endif
The reason that snippet is checking to see if health is greater than damage, is that if it isn't, your character is dead (assuming death occurs at health <= 0).
Also, the health could be increased when nice things happen, such as when your character eats an apple:
if (apple_eaten = 1) AND (health < 100)
if (health > 90)
health = 100
else
health = health + 10
endif
endif
Thats all very over-simplistic. I imagine you'll want to use types and arrays to store all your characters' stuff in one central place. Health might be part of an array or a type, for example.
Phil
What do you mean, bears aren't supposed to wear hats and a tie?