Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Basic4ppc Wishlist Missing any feature?

Left() and Right()

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-16-2008, 04:29 AM
JesseW's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2008
Posts: 250
Default Left() and Right()

Being a seasoned veteran to the Basic programming lang, but a noob to B4P, I was saddened to see the string manipulation functions Left() and Right() omitted from b4p. I know I can use subString() but it's just not the same, and it causes me to have to divert my train of thought from what I'm working on to coding something that's been in basic for 20+ years. Pleeze...
Reply With Quote
  #2 (permalink)  
Old 10-16-2008, 06:23 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,461
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

There exist a library with VB like functions here.
http://www.basic4ppc.com/forum/itali...html#post16101
written by maxim in the Italian Forum.

Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #3 (permalink)  
Old 10-16-2008, 08:07 AM
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

There's also my StringsEx library which has some VB like functions as well as exposing most of the .NET string methods. http://www.basic4ppc.com/forum/addit...library.htmlIt also includes Stringbuilder for efficiently building and manupulating strings.
Reply With Quote
  #4 (permalink)  
Old 10-16-2008, 04:37 PM
JesseW's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2008
Posts: 250
Default

thanx guys. i'm going to like it here
Reply With Quote
  #5 (permalink)  
Old 10-16-2008, 06:17 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,689
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

OOPS. This post should have been here: http://www.basic4ppc.com/forum/basic...html#post17568
Reply With Quote
  #6 (permalink)  
Old 10-17-2008, 08:45 PM
Basic4ppc Veteran
 
Join Date: Jan 2008
Posts: 215
Default string functions

I used to keep my "VB" string functions in a text file and add them with the "Tools->Components->Add Code" menu option but when agraham released his string library I switched to that.

' These functions saved to file "strings.txt"
Code:
Sub Left (str, n)
    
Return SubString(str,0,n)
End Sub

Sub Right (str,n)
    
Return SubString(str, StrLength(str)-n,n)
End Sub

Sub Mid (str,x,n)
    
Return SubString(str,x-1,n)
End Sub

Sub Ltrim (str)

    
Do
    x=x+
1
    
Loop While StrAt(str,x)=" "
    
Return SubString(str,x, StrLength(str)-x)
    
End Sub

Sub Rtrim (str)
    x=StrLength(str)
    
    
Do
    x=x-
1
    
Loop While StrAt(str,x)=" "
    
Return SubString(str,0, x+1)
    
End Sub

Sub Len (str)
    
Return StrLength(str)
End Sub

Sub Reverse (str)
    x=StrLength(str)+
1

    
Do
        newstr=newstr & SubString(str,x-
1,1)
        x=x-
1
    
Loop While x > 0
    
Return newstr
End Sub

Last edited by digitaldon37 : 10-17-2008 at 09:35 PM.
Reply With Quote
  #7 (permalink)  
Old 10-18-2008, 05:58 AM
JesseW's Avatar
Basic4ppc Veteran
 
Join Date: Oct 2008
Posts: 250
Default

Thanks everyone for the handy tips....
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
Desktop IDE default width of left window Rioven Basic4ppc Wishlist 1 09-20-2007 06:36 AM


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


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