# Image doesn't load at 'else'

**URL:** <https://forum.servoy.com/t/image-doesnt-load-at-else/2596>\
**Category:** Classic Servoy\
**Created:** [August 30, 2004, 7:40pm UTC](https://forum.servoy.com/t/image-doesnt-load-at-else/2596 "2004-08-30T19:40:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karel\_Broer](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Karel\_Broer](https://forum.servoy.com/u/Karel_Broer)\
**Post date:** [August 30, 2004, 7:40pm UTC](https://forum.servoy.com/t/image-doesnt-load-at-else/2596/1 "2004-08-30T19:40:12Z")

</div>

Hello everyone,

I’ve got this method:

```auto
if (recordstatus != null)
{
   if( recordstatus == "1")
   { 
   return '<html><img src="media:///bullet_ball_green.png"></html>;' 
   } 
   if( recordstatus == "2")
   { 
   return '<html><img src="media:///bullet_ball_blue.png"></html>;' 
   }
   if( recordstatus == "3")
   { 
   return '<html><img src="media:///bullet_ball_red.png"></html>;' 
   }
}
else
{ 
return '<html><img src="media:///bullet_ball_blue.png"></html>;'
}

```

Everything works, except the ‘else’ function. I guess I forgot something, but what ![:?:]( "Question")

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [August 31, 2004, 7:04am UTC](https://forum.servoy.com/t/image-doesnt-load-at-else/2596/2 "2004-08-31T07:04:36Z")

</div>

I think you have to switch the ; and ’ at the end of the return statement, but the strange thing is that in the other cases, you have also done it this way…

Also, if recordstatus is not null, you go into the “If then” part, where you only capture situations 1,2 and 3. What happens if recordstatus is empty (“”) or 4, for example?

Paul

---

<div class="post-metadata">

**Author:** ![Karel\_Broer](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Karel\_Broer](https://forum.servoy.com/u/Karel_Broer)\
**Post date:** [August 31, 2004, 11:27am UTC](https://forum.servoy.com/t/image-doesnt-load-at-else/2596/3 "2004-08-31T11:27:07Z")

</div>

Hi Paul,

Thanks for the tips, but Else just didn’t work at the end of the method, so I solved it by

```auto
if (recordstatus == null)
   {
   return '<html><img src="media:///bullet_ball_blue.png"></html>'
   }
else
{
   if( recordstatus == "1")
   { 
   return '<html><img src="media:///bullet_ball_green.png"></html>'; 
   } 
   if( recordstatus == "2")
   { 
   return '<html><img src="media:///bullet_ball_blue.png"></html>'; 
   }
   if( recordstatus == "3")
   { 
   return '<html><img src="media:///bullet_ball_yellow.png"></html>' 
   }
}

```

Bit strange, but it works this way..  
 ![:?]( "Confused")

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [September 8, 2004, 8:11am UTC](https://forum.servoy.com/t/image-doesnt-load-at-else/2596/4 "2004-09-08T08:11:03Z")

</div>

Seems impossible to me, your field recordstatus must have had the value 1 all the time.
