Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Help with code

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-21-2007, 03:47 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default Help with code

I have four rows of text boxes(4 textboxes per row).One textbox in each row
has a value of 100 for as a defalt(will never change).
After the program runs all other textboxes will have a value from 0 to well in
the hundreds.Only one of these rows will have all the textboxes in the range
of 0 to 100.All I need is that row with the values of 0 to 100.

Here is how I would like to do it but for obvious reasons cant happen.This is were i need your help.

If textbox1.text=<100 and
textbox2.text=<100 and
textbox3.text=<100 then
Form1.Show
Else If textbox5.text=<100 and
textbox6.text=<100 and
textbox8.text=<100 then
Form.Show
Else If ect.,ect.,get the point

As you see textbox4 and textbox7 already has a defalt value of 100 so there not needed here.And I will have a form for each row to reside in(4 in total).
Ive got this part covered.Its the example sateted above that is my only draw back.
Reply With Quote
  #2 (permalink)  
Old 09-21-2007, 05:54 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

instead of nested ifs you could use case select...

Still I dont underrstand your question exactly, as your description is very complete but ab bit confusing....I guess you want to know when to show the form for the un-altered row?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #3 (permalink)  
Old 09-21-2007, 06:48 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default

Food for thought:It looks like this before run time.

100 0 0 0
0 100 0 0
0 0 100 0
0 0 0 100

When done it look like this:

100 47 753 301
215 100 162 650
13 6 100 40
33 15 250 100

Or this:

100 8 246 7
132 100 325 96
41 3 100 3
138 104 340 100

And so on and so on.

Last edited by cdeane : 09-21-2007 at 06:55 PM.
Reply With Quote
  #4 (permalink)  
Old 09-21-2007, 06:54 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by cdeane View Post
Food for thought:It looks like this before run time.

100 0 0 0
0 100 0 0
0 0 100 0
0 0 0 100

When done it look like this:

100 47 753 301
215 100 162 650
13 6 100 40
33 15 250 100

Or this:

100 8 246 7
132 100 325 96
41 3 100 3
138 104 340 100

And so on and so on.
An what you what to do is to show a form acordingly to what row has all values above 100, yes?

What if two rows have their values above 100?

For the first part you can use the ensted if as they work fine with this...for the second is a bit more complicated...
basically you need to teste wich rows are above 100, and maybe the highest values?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #5 (permalink)  
Old 09-21-2007, 07:02 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default

no,
Equal to 100 or below to 0 and above
Reply With Quote
  #6 (permalink)  
Old 09-21-2007, 07:09 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by cdeane View Post
no,
Equal to 100 or below to 0 and above
I think you mean =<100 And =>0,yes?
have you thought about having more than one row with valid result to this expression?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #7 (permalink)  
Old 09-21-2007, 07:11 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default

Meaning only between and equal to 0 and only 100.

If you look in each example you can see it.
Reply With Quote
  #8 (permalink)  
Old 09-21-2007, 07:15 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default

Quote:
Originally Posted by Cableguy View Post
I think you mean =<100 And =>0,yes?
have you thought about having more than one row with valid result to this expression?
yes,and it works just fine until i hit my nimas 0 then it out the door
Reply With Quote
  #9 (permalink)  
Old 09-22-2007, 10:58 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Does this do what you want? The textboxes are named according to their row and column. Depending upon the exact use the comparison of Text to the number 100 should probably be made a bit more rigorous by explicitly converting the text to a number rather than relying on an implicit conversion that may throw an error under some circumstances.
Code:
Sub GetLowRow
    
For Row = 1 To 2
        Count = 
0
        
For Col = 1 To 4
            w = 
"TextBox" & Row & Col
            
If Control(w).Text <= 100 Then
                Count = Count + 
1
            
End If
        
Next
        
If Count = 4 Then
            
Return Row
        
End If
    
Next
    
Return -1
End Sub
Reply With Quote
  #10 (permalink)  
Old 09-22-2007, 04:30 PM
Knows the basics
 
Join Date: Aug 2007
Location: Arkansas
Posts: 68
Default

Quote:
Originally Posted by agraham View Post
Does this do what you want? The textboxes are named according to their row and column. Depending upon the exact use the comparison of Text to the number 100 should probably be made a bit more rigorous by explicitly converting the text to a number rather than relying on an implicit conversion that may throw an error under some circumstances.
Code:
Sub GetLowRow
    
For Row = 1 To 2
        Count = 
0
        
For Col = 1 To 4
            w = 
"TextBox" & Row & Col
            
If Control(w).Text <= 100 Then
                Count = Count + 
1
            
End If
        
Next
        
If Count = 4 Then
            
Return Row
        
End If
    
Next
    
Return -1
End Sub
Ok,I think I know were this is going.It looks promising.I may need some time to to play with it.(I am new to this).I was all about spreadsheets at one time.

Thanks

Last edited by cdeane : 09-22-2007 at 05:27 PM.
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
code just... stops! Offbeatmammal Questions (Windows Mobile) 4 06-02-2008 07:30 PM
Add Code giannimaione Questions (Windows Mobile) 5 06-01-2008 06:03 PM
reg code question scott93727 Questions (Windows Mobile) 2 05-30-2008 12:24 PM
Where is Form Code? enonod Questions (Windows Mobile) 2 10-13-2007 12:04 PM
Code files jerryjukem Questions (Windows Mobile) 1 07-28-2007 06:57 PM


All times are GMT. The time now is 11:17 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0