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.

return issue

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-20-2007, 10:21 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 return issue

Hi,guys

I have a sub calling another sub several times in order to give me a random on/off state, like this:

sub setup
....
image1.image=rnd_img(state)&".png"
....
image2.image=rnd_img(state)&".png"
....
End Sub

Sub rnd_img
x=rnd(0,2)
if x= 0 then state="ON" Else state="OFF"
retun(state)
End Sub

The return keyword errors with a "FormatException" so nothing is passed to the calling sub...
Why??
__________________
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
  #2 (permalink)  
Old 09-21-2007, 06:01 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,734
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You should change it to:

return state
instead of
return (state)
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
return codes of a shell command pmu5757 Questions (Windows Mobile) 18 06-15-2008 07:33 PM
Can a sub return more than 1 value ? TWELVE Questions (Windows Mobile) 13 05-28-2008 09:58 AM
All hail GeoTrail's return RandomCoder Chit Chat 1 02-17-2008 12:14 PM
Return value from Form ghislain Questions (Windows Mobile) 5 12-23-2007 07:34 AM


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