Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Left, Right, Mid Something Else


i have a label caption which changes in length of letters each time i use it but the the last four letters are always the same.

i need to put the caption into another label without the last four letters but dont know how because the length of letters change all the time.

any ideas!

thanks
thingimijig.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
List View - Shifting Values From Right To Left If Left Column Is Empty [SOLVED]
I'm having a problem with ListView... if I delete a field value from any record, the remaining values from the other fields to the right of the empty field will "shift" to the right to ocupy the empty field.. the last field in the Db will now show empty.... this just happens in List View not in the actual Access DB

This is part of the code I'm using to populate the ListView

Code:

Public Sub PopluateListView(SQL As String, Lv As ListView)
    
    On Error Resume Next
  Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    
  Dim i As Long
  Dim j As Long
  Dim k As Long
    rs.Open SQL, cn, adOpenStatic, adLockOptimistic
    
    frmFieldsView.Caption = "Viewing Table " & frmDBTView.TableView1.SelectedItem.Text
    For i = 0 To rs.Fields.Count - 1
        Lv.ColumnHeaders.Add , , rs.Fields(i).Name
    Next i
    frmDBTView.ProgressBar1.Max = rs.RecordCount
    frmDBTView.ProgressBar1.Value = 0
    Screen.MousePointer = vbHourglass
    For k = 0 To rs.RecordCount
        If IsNull(rs.Fields(0).Value) Then Lv.ListItems.Add , , "" Else Lv.ListItems.Add , , rs.Fields(0).Value
        For j = 1 To rs.Fields.Count
            If IsNull(rs.Fields(1).Value) Then Lv.ListItems.Item(k + 1).ListSubItems.Add , , "" Else Lv.ListItems.Item(k _
                + 1).ListSubItems.Add , , rs.Fields(j).Value
        Next j
        frmDBTView.ProgressBar1.Value = k
        rs.MoveNext
    Next k
    frmFieldsView.StatusBar1.Panels(1).Text = "Record(s) " & rs.RecordCount
    frmDBTView.ProgressBar1.Value = 0
    Screen.MousePointer = vbArrow
    rs.Close
    Set rs = Nothing
    
End Sub


What am I doing wrong?

Thanks for any help

_________________________________________________________________

Edited by - vbprog1144 on 4/9/2005 11:19:53 AM

Picture1.left = Picture.left - 200
I would like some help, when i do this with my code, i always get this black sort of flash across the page every time the graphic moves... do you know how to get rid of this? Thanks!

Heres the code i used.

Private Sub Timer1_Timer()
burns.Left = burns.Left - 500
Timer1.Enabled = False
Timer2.Enabled = True
End Sub

Private Sub Timer2_Timer()
burns.Left = burns.Left + 500
Timer2.Enabled = False
Timer1.Enabled = True
End Sub

Thanks Again

Difference Between Left And Left$
This applies to many functions but I have been wondering what the difference between

Left(txtName.Text, 5)

and

Left$(txtName.Text, 5)

This also applies to UCase, LCase, Trim, etc...

Thanks

Jim

Left$() Vs Left() **Resolved**
I read recently that using the dollar ($) in your functions has performance benefits, is this the case and why?

e.g. -
Left$() V's Left()
Trim$() V's Trim() etc.

Pointers to articles or an explanation would be greatly appreciated

Thanks Al

Left Versus Left$
When I look up Left$ Function or Left Function (Right$, Right), my MSDN documentation retrieves the same description (Left Function).

There was a Post to some Thread which implied that Left$ was faster or better. Is this true? If so, why does the MSDN documentation not say so?

Might this be a backward compatibility issue?

Diff B/w Left And Left$
Hi..
what is the difference between any function name and function name with $

Ex. Left() and Left$(), Right() and Right$()

.. if no difference, what that $ symbolises

thanks in adv.. Venu

Differance Between Left Join & Left Outer Join?
I come across one question in recent inter view
can any one tell me the differance between Left join & Left outer join?
Thanxs in Advance

Right Left And Mid
Okay, I transfer the source of the game I'm working on to my laptop, and for some strange reason, the Right(), Left(), and Mid() functions are giving me trouble. Everytime i try to execute it, it chokes and screams "Object or Library Not Found" or something of the like... anyway, it brings up the Refrences window expecting me to check something.. but have no idea what the problem is... Aren't those commands part of VBA? I do have a lot of other refrences checked, could that have something to do with it?

Right-To-Left
Hi!

Any one Know where can i get ActiveX controls for VB6 that support Right-To-Left property?
(Specialy TreeView and ListView)

Left = Left
Hey guys, I'm working on a modified original Mario game, but have run into a few problems. I have an enemy (Goomba) set to walk to the left at a 100 interval, and the user can tell the main character (Mario) to walk to the right, left, or jump. I'm trying to make it so that if the Goomba and Mario are in the same .Left position, that Mario will lose a life. I tried imgAttack.Left = imgWalk.Left but it didnt do anything, I also tried to use variables but they didn't do anything either. Can someone tell me how to make it so that they will run into each other?? I'll post the code here so you can maybe see what I'm talking about.

Private Sub tmrAttack_Timer()
imgAttack.Left = imgAttack.Left - 100
Attack = Attack + 1

If imgAttack.Left < 0 Then
imgAttack.Left = 10000
End If
If Attack = 14 Then
Attack = 1
End If

If imgAttack.Left = imgWalk.Left And imgJump.Visible = False And imgJump2.Visible = False Then
tmrAttack.Enabled = False
tmrJump.Enabled = False
imgWalk.Visible = False
imgAttack.Visible = False
End If

End Sub

Left Right Mid
Stop posting in bold and large fonts

What Is Left And Right Mean?
Yeah so I am programming and saw Rect.Left and Rect.Right?
.Right?
Is that like the Y or X?

I know that .Left should be X so would right be Y?

Using LEFT
I'm trying to do thisIf Left(string,4) = "" then But .NET is making me add Microsoft.VisualBasic.If Microsoft.VisualBasic.Left(string,4) = "" then How do I fix this?
I dont understand why basic basic commands wont just work ...

I've thought about adding With Microsoft.VisualBasic but that would be silly since it IS visual basic already!

Thanks

Getting Everything To The Left Of :
im making a proxy program and I have the user enter a list of proxies but i need them to be divided up between remote host and remote port. so i want to get everything to the left of the ":". how would i do this?

Mid, Left Or Right ?
i have this in a list box

\I1-01
\I1-02
and so on.......

what would i need to do to remove the "\" from the string and just display the rest ?

would i need to use mid ?

Right N Left
Code:
If InStrRev(Temp2, "-") <> 0 Then
RightLow = Left(Temp2, InStrRev(Temp2, "-") - 1)
RightHigh = Right(Temp2, Len(Temp2) - InStrRev(Temp2, "-") - 1)
End If

I'm using this code to get the two numbers out of a string (example string "1-10"). Since i used the Right and Left function all along I thought it would work smoothly but how wrong I was.
I always get the error:


Code:
Wron number of arguments or invalid property assignement.
But I'm sure that the Syntay is

Right(string, Length)

So what does the compiler mean?

Thanks in advance for your help and replys

Sql Help - LEFT !
1.in access,following query works just fine :

select left(field1,?),sum(field2)
from table
group by left(field1,?)
.....
2.but,
when i try to run exact same query from sql pane VB6,
i receive error :"You tried to execute a query that does not include specified expression 'LEFT(field1,?)' as part of an agregate function.
with parameters within query,for example ?=1,it works just fine.
3.i tried to save query in access ,as left.
VB6 can "see" it as stored procedure, but also i can't pass parameter from VB6!

can anyone help, please!

.left
I downloaded an application from the Code Corner (thanks CL). I ran it and it works fine. It can do alot more than I want so I started cutting out the part I need. Now when I run it there is an error saying that the Method or Data can not be found when the .Left, .Right , .Top and .Bottom are used. I tried checking what options it gives after the period and they are .Min and .Max.
Is it an API that gives me the .Left, .Right , .Top and .Bottom or is it something else.

Thanks

Left$
hi all,
i have a textbox, in which i have text something like

Vbforums

and i want to use this code


Code:
Dim Str As String
Dim Que As String
Str = Left$(Text1.Text, 2)


for Saving the forums in the variable Que.

i know, i can do it by using Len function and can use Right$ in place of Left$.
but i want to go to this way im tring in my above code.
and also i want to remove VB from Text1, i mean i want remove the first two characters in the TextBox
pls help

Getting Left Behind...
I see the 2nd Beta of VS2008 is available now. I have just begin moving some of my systems to VS2005. It is exhausting trying to keep current.

Left$
For some reason when I start a new project or open some (not all) existing projects and attempt to use the 'Left' function it does not show the required paramaters (image below).

Has anyone had this problem before and if so how is it solved?

Thanks.

Right To Left EXE?
Hello,
I had this application compiled, where I had all the elements in it right to left =true, it worked fine on my computer, but when I try it on another computer. It seems as if right to left is disabled. thangs are listed on the left, and pretty much everything else. Any ideas on how to fix this?

How To Use Left(or Something Like It)
ok my problem is i have a program that uses winsock to send a message called
"BOX:" and then the message an when the client gets the message i want it to be displayed in a message box

Example
Server->sends "BOX:" & "TESt"

the client would get "BOX:TEST" how can i make it so the BOX: doest appear in the message box

(sorry if this is confusing)

-BladeZ

Left And Right
VB Code:
Private Sub Command1_Click()Dim x As IntegerDim val As String val = Text1.TextFor x = Len(Text1.Text) To 32  val = val + Right(val, 1)  List1.AddItem valNext x End Sub


dg gave me this code b4, takes the last letter of text1 and adds it to text1 until 32 chararcters long, i do i take the second letter and do the same thing. Example
Text1 is Rick

Riick
Riiick
Riiiick
Riiiiick

etc,

Thx in Advance

Mid(, Left, Right ...ect ...
the other day in classes i learned about the use of strings with mids, lens n such, and i saved it all to a disk, of course someone had to go and steal my disk , and now i am stuck with nothing to do my homework project with... i am not asking you guys to do it for me, but rather to maybe help me, by reteaching me what i learned in class on the disk that was stolen, if you could just help guide me through it, it would be a huge help ..here the problem ...

Create a Monogram application that allows the user to enter his or her first, middle, and last name and then displays a Monogram with the first, and middle initials in lowercase n the last initioal in uppercase.

i already set up the text box(txtenter), label (lbldisplay), and button(cmdMonogram) ... i dimmed str1 as a string... thanks guys.

Left, Right, Mid Something Else
i have a label caption which changes in length of letters each time i use it but the the last four letters are always the same.

i need to put the caption into another label without the last four letters but dont know how because the length of letters change all the time.

any ideas!

thanks
thingimijig.

If Anyone Have 3-15 Min Left Over!!
Please then goto this post:

http://www.vbforums.com/showthread.p...40#post1330140

And download the ZIP there..

It contains my weak attempt to access a SQL database from
an VB app...

But i have only tested it locally, where it ofcourse works, but could anyone please test it remotely?
Just post here if you get errors, or if you get connected!

If you get errors, try to solve them and tell me where i coded wrongly... Please, I really need help on this too "

Right, Len And Left Help...
txtC.text = "http://mp3.nemexis.com/user/bin/willsmith/albums/"

Dim Urlstr$
Urlstr$ = Right(txtC.Text, (Len(txtC.Text) - 32))
Left(txtC.Text, (Len(txtC.Text) - 8))

Results.Text = Urlstr$


i'm trying to get "willsmith" alone in the Results box

Left()
anybody an answer for this?

i use several times in my code the function Left(..)
when i try to run the program, the compiler stops at each line with Left(..) ...

tia

Right To Left
i have a project that uses the right to left property on most controls as true and i installed it on 2 computers on the first computer everything is ok but on the second one the right to left does not seem to work , does anyone have an idea why?

Left &amp; Right
If the left side of the screen is set to 0 (x &y coordinates) then
what is the right side set to?

Left$ And Left
I have come across a tutorial using a number of string manipulation functions, Left$, Trim$. I looked in MSDN and both took me to the same definition of the Left function.

I was wondering what the difference was between Left and Left$ if there is any. My first thought was that the $ is a vb5 version but as I only started programming in VB6 I have little experience of previous VB versions.

I'm asking out of curiosity mainly.

Left$ In SP 5
I just installed SP 5 for VB 6 and now I cannot get my program to run. It halts on a Left(x,y) statement and says that it expects an array. Did the Left function get dropped? What replaced it?

Thanks.

Hey Where Did My LEFT Go??
This really isn't a big deal but it kinda bugs me... in VB.. the Left() function does not use intellisence... anyone know why?

so if i type right( it comes up with Right(String,Length as Long) just like any function or sub would.. but when i do the same thing with Left... NOTHING I mean it works fine in the code when it runs and everything.. i just think it is weird that it doesn't show up with the function parameters when I am coding it

Right To Left
I wanted a right-to-left edit box for an Arabic application in visual basic and i got it, the code for it is :

first set the alignment of the text box to right

then add the following code to the change() event of the text box

Text1.SelStart=0

but the problem is that it takes the cursor to the start of the textbox, it does not add the character to before the current character position.

what shall i do in this case....

Right To Left...
How can i right align a list view?
Or maybe a list box?

thanks in advanced..

Right$ Left$
hi,

with dir1.path i can get the full pathname, but now i want to have only the last path from it. So if the fullpathname = c:program FilesMicrosoftVbExample i want the dir Example back in a string.. Can it be managed with the right$, left$ functions?

Left$
Hi Everyone,

Is there any such thing as a left$. I want to capture the first 3 letters of a name but I cannot get the VB program to recognize the Left$ procedure. For example, I want this.

Name = Inventory


Code:
strFile = Left$(" & Text1.Text & ", 3)


New Name = Inv

Left = Left$ (?)
What is the difference between the Left Function and the
Left$ Function? Their MSDN documention show no difference,
if they are the same what's the point of making 2 functions
that do the same thing?

Max Top And Left
Is there like a maxleft or maxtop property? because I want the startup form of my app to show up in the very bottom right corner of the screen, no matter what the resolution of the screen might be.

Left Or Left$
I think both XxEvilxX and wossname are pouring water outside the flower vase!
"Left$" is a function in Q Basic to retrieve a portion of a string counting from left side, and "Rigth$" is the like for right side.
In VB they are "Left" and "Right", respectively.
Right$ and Left$ still work only for the sake of compatibility but they are not guaranteed to work in VB7 or future versions.

Right To Left Tab
Hi

I want to use a right to left tab in a Visual Basic6 project. I want to use a tab control that it's Tab headers containing Tab captions start from the right side of the tab.
thank you for your help.

Left(((
hai,


I am creating a interface where it converts data into a text file. I have almost finished my project. but I have a problem in exporting certain type of data.


I want the the records to display like the bwlow line in my text file.

200 3456356 585739

but I get

2003456356585739

This is the code I have written, I works fine for textfeld

Left(rs!amount, &"", 10) & _
                  Left(rs!childid, &"", 13) & Left(rs!partnerid, &"", 10)


Thanks for your help




Edited by - fredric on 6/21/2002 6:28:04 AM

AVI Left Or Right!!
i playing a AVI that have 2 language. left is english and right is other language. i try to use "setaudio video1 source to right/left" to play neither one of the language but it doesn't work.


Any one can give me help?

Left;right;up;down
what is the ASCII code for left;right;up;down keys ?

Right To Left
hi
does masked edit control facilitate to enter data from right to left.
that is i want to enter number from right to left in the masked edit control

vijay

That Logo In The Top Left
can you change what is in the menu when you click in the icon in the top left hand corner of an application (or when you right click on it on the taskbar)
THanks,
-Gaz

Right To Left Programming
Hi every body

I want to write a program (that have Arabic language) and I have to make all forms and controls Right To Left, I made some, but I can not find how can I change menu direction to Right To Left?

Is there any one to help me?

--Thanks

Zeros On The Left?
This may sound stupid for you but I want to make the zero on the left of a number to appear and I can't find a format that allows it. Example: 2 to show as 02. Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved