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.


Error on compile with Optimising


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-25-2008, 08:11 AM
Newbie
 
Join Date: Sep 2007
Posts: 3
Default Error on compile with Optimising

Hi,

I am using the supplied sample for HTTP

I have a problem with the following line of code in V6.01:

FileOpen(c1,UploadFile,cRandom)

This builds OK and compiles OK with Optimisation off.
With Optimising ON however, I get an error:

Index was out of Range. Must be non-negative an less than the size of the collection.
Parameter name:Index

This line of code is from the HTTP Sample and compiles - runs fine in V5.x

Any thoughts greatly appreciated.

Best Wishes

Tony Hunt
Reply With Quote
  #2 (permalink)  
Old 01-25-2008, 03:56 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 672
Default

Hi TonyGprs,

the real problem is located in the line before because the Byte array must be declared as a global variable: HTTP upload sample


specci48
Reply With Quote
  #3 (permalink)  
Old 01-27-2008, 11:46 AM
Newbie
 
Join Date: Sep 2007
Posts: 3
Default

Thank you specci48,

Unfortunately I had already spotted using V5.x.

The problem is still there.
Reply With Quote
  #4 (permalink)  
Old 01-27-2008, 11:51 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,334
Default

Can you post your code?
Reply With Quote
  #5 (permalink)  
Old 01-27-2008, 12:15 PM
Newbie
 
Join Date: Sep 2007
Posts: 3
Default

Hi,
Thanks for the quick response.

While collecting the code to post, I have found the problem.

The original code in the sample is.

Sub UploadFile (UploadFile, URL) 'Requires a server with write permission.

NOTE.. The Sub name is the SAME as the first parameter IE:UploadFile

So when the code
FileOpen(c1,UploadFile,cRandom)
is compiled USING THE OPTIMISER IN V6.01, it looks as though it's passing the sub UploadFile as a parameter to the function FileOpen()


Change this to..
Sub UploadFile (LocalFile, URL) 'Requires a server with write permission.

then..
FileOpen(c1,LocalFile,cRandom)


This Now Optimises and runs fine.. It's obviously the result of the less forgiving new compiler..

That can only be a good thing.

Best wishes for your excellent product..

Tony Hunt
http://www.gprsdatasystems.com

Last edited by TonyGprs : 01-27-2008 at 12:32 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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile error Ricky D Questions & Help Needed 2 09-08-2008 01:21 PM
error compile manu Beta Versions 6 08-28-2008 10:14 PM
var_ags compile error agraham Beta Versions 1 08-28-2008 01:43 PM
Inconsistent compile error agraham Beta Versions 1 08-27-2008 06:34 PM
Compile error enonod Questions & Help Needed 5 05-29-2008 12:38 PM


All times are GMT. The time now is 01:33 PM.


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