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.


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: 1,112
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

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD
Reply With Quote
  #2 (permalink)  
Old 09-21-2007, 06:01 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,817
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
return codes of a shell command pmu5757 Questions & Help Needed 18 06-15-2008 07:33 PM
Can a sub return more than 1 value ? TWELVE Questions & Help Needed 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 & Help Needed 5 12-23-2007 07:34 AM
Retrieveimage issue Cableguy Questions & Help Needed 0 06-02-2007 05:49 PM


All times are GMT. The time now is 12:36 PM.


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