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.

Downloadfile and text files

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-16-2008, 11:50 AM
Senior Member
 
Join Date: Sep 2008
Posts: 161
Default Downloadfile and text files

I tried using downloadfile to retrieve CSV and text files and they are rendered unusable when downloaded to the device.

They turn from this:
Hello
This is a test

To this:
Hello[]This is a test

The line breaks get replaced with rectangle characters (unknown character) and it renders the file useless.

Is there a fix to this?
Reply With Quote
  #2 (permalink)  
Old 10-16-2008, 11:54 AM
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

You could search the returned string and replace all the "[]" by "crlf"...

Something like
newstring=StrReplace (oldstring,"[]","crlf")
__________________
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 10-16-2008, 12:47 PM
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

Do you mean this http://www.basic4ppc.com/forum/quest...oad-files.html

How are you displaying the file when you are seeing those rectangular characters? Rectangular boxes are unprintable characters. You can check what they are by
Code:
nstr = ""
For i = 0 to Strlen(Str) - 1
  nstr = nstr & 
Asc(StrAt(Str, i) & " "
Next
Msgbox(nstr)
A line break should be 13 (Cr) followed by 10 (Lf)
Reply With Quote
  #4 (permalink)  
Old 10-17-2008, 02:55 AM
Senior Member
 
Join Date: Sep 2008
Posts: 161
Default

I found the solution!

The unknown character is chr(10). You have to replace it with chr(13) & chr(10) usung StrReplace.

Thanks for your help!
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
Text Files Erel Tutorials 14 04-24-2009 08:26 AM
Searching all text files in a directory tsteward Questions (Windows Mobile) 5 01-03-2009 04:08 PM
Coverting text files with binary file page code functionality kolbe Code Samples & Tips 1 06-21-2008 05:06 PM
Text editor for INI files Softselect Questions (Windows Mobile) 2 11-15-2007 06:50 AM
Dividing the code into text files... Cableguy Questions (Windows Mobile) 5 05-21-2007 03:21 PM


All times are GMT. The time now is 07:46 AM.


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