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.


what are the codes for CR and LF?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-02-2007, 05:43 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default what are the codes for CR and LF?

Hi,

I want to know the codes for CR and LF or CRLF. I am writing a subroutine in which a string is truncated after a pair of numbers separated by a CRLF (which takes 2 places in the string).
The datastring = "1,0" & CRLF & "2,0" & CRLF & "3,0" & CRLF & "4,0" & CRLF & "5,1" & CRLF & "6,0" & CRLF & "7,1" & CRLF & "8,0" & CRLF & "9,1" & CRLF & "10,1" & CRLF
But after reading the pair "5,1" the subroutine doesn't recognize the CRLF anymore. This is due to the 1 after the 5 (I changed this to try out).

the subroutine is
s = 0 '// set STOPsign
k = 0
dd = 0
DO WHILE (k < StrLength(D$)-1) AND (s=0)
T$ = StrAt(D$,k)
IF T$ = cCRLF then
dd = k
s = 1
END IF
k=k+1 'remember there is always an increment after the stopsign
LOOP

Any ideas?
thnx
Marc
Reply With Quote
  #2 (permalink)  
Old 06-02-2007, 06:00 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

I'm not sure I've understood your problem but crlf = Chr(13) & Chr(10)

BTW, there is no need to use the $ sign for string variables.
Reply With Quote
  #3 (permalink)  
Old 06-02-2007, 06:03 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Erel,
Thnx, I know about the $ sign but I am tranlsating old code here and it kind of sticks on my mind.....
Still don't know why the subroutine errors though...
Marc
Reply With Quote
  #4 (permalink)  
Old 06-02-2007, 06:25 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

Are you using version 5.00?
You should see an error on this line:
IF T$ = cCRLF then..
As you've misspelled the constant crlf.
Reply With Quote
  #5 (permalink)  
Old 06-02-2007, 06:28 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Yes I am using 5.00. Which Error did I make? I got no signal....
Reply With Quote
  #6 (permalink)  
Old 06-02-2007, 06:29 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Because CRLF doesn't work with the string and cCRLF does.....
Reply With Quote
  #7 (permalink)  
Old 06-02-2007, 07:50 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

cCRLF is not a constant. It is probably a variable you are using somewhere else.
Are you using the Check unassigned variables option?
Reply With Quote
  #8 (permalink)  
Old 06-02-2007, 08:15 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 200
Default

Hi Erel, No I am not using it elsewhere and I always uncheck the unassigned variables because it is a bit annoying when translating from other code.
But I got it working using CHR(13) and not the CRLF constant....
thnx
Marc
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
Codes Unable to run no VISTA tcgoh Questions & Help Needed 4 08-19-2008 04:17 PM
return codes of a shell command pmu5757 Questions & Help Needed 18 06-15-2008 08:33 PM


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


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