when you are concerned about gaining/losing weight the main thing to concentrate on is the calorific value of the food, usually given as a value of hundreds, or possibly thousands of kcal's, i think its at the top of the nutritional values table on food.
Some foods lead you to believe that they are healthy as they are "fat free" but these can still be extremely fattening foods due to their high sugar content.
Both sugar, or carbohydrates, and fat are fattening when eaten in large amounts. Again in the nutritional values table it tells you how much of the carbohydrates you are consuming are sugars, "of which sugars."
In all if you are concerned about weight it is your calorie intake that you need to watch rather than the sugar or fat content.