Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Index problem in the IF statement


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-03-2007, 11:39 AM
Newbie
 
Join Date: May 2007
Posts: 5
Default Index problem in the IF statement

Hi all,

I have a problem with the following statements.
Code:
Sub btnRechnen_Click
	  IF label5.text="......" then
		  MsgBox("Standort auswählen")
	  Else if
		  for i=0 to Table1.RowCount-1
		  ……………
		  …………
Is the value of label5.text=”......” the program works fine.
Is there an other value in label5.text (in my case a numeric value)
the program stops.

Quote:
IF label5.text“……“ then
Error description:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
any idea?

thnx for your help
Markus
Reply With Quote
  #2 (permalink)  
Old 06-03-2007, 11:45 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

You should use Else instead of Else If (as you didn't use a condition):
IF label5.text="......" then
MsgBox("Standort auswählen")
Else
for i=0 to Table1.RowCount-1
……………
…………
Reply With Quote
  #3 (permalink)  
Old 06-03-2007, 02:10 PM
Newbie
 
Join Date: May 2007
Posts: 5
Default

Hi Erel

yes, yes, mh…….. i should know this…, sorry.

Thanks a lot for your help

Regard
Markus
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieve images and index lux1963 Questions & Help Needed 3 05-18-2008 02:42 PM
Addrow like removerow(index) Vito Questions & Help Needed 3 02-04-2008 02:09 PM
MP3 reading, fullscreen form, PDA buttons control, Sound statement, PDA Radio, etc UTISS.DEV01 Questions & Help Needed 2 01-03-2008 04:08 PM
TextBox, Index & Arraylist Peptone Questions & Help Needed 3 11-19-2007 04:58 PM
Index was out of range error in version 5 HARRY Questions & Help Needed 6 05-20-2007 09:16 AM


All times are GMT. The time now is 04:37 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0