Author Topic: Sentence Split  (Read 37223 times)

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sentence Split
« on: October 08, 2005, 10:22:03 AM »
I hope its ok to ask about VB that doesnt have to do with DB here.

Anyhow im wondering how its done to split a sentence. Like if I have Sentence "ABC" I should be able to split it up to 2 sentences that is like "A" and "AB"
how do I do?
« Last Edit: October 08, 2005, 10:31:06 AM by zelos »
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sentence Split
« Reply #1 on: October 08, 2005, 11:26:45 AM »
Na, it's fine.

The character "_" spits a VB line across multiple lines.

For instance:

form1.caption = "Hello my name is!  Hello my name is!  Hello my name is" + _
                        "The Real Slim Shady."

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sentence Split
« Reply #2 on: October 08, 2005, 11:52:28 AM »
no I mean, if I have a sentence like "Hi, my name is zelos" I want to have somekinda command that can store in a memory the letters between X and Y position, so between 5 and 8 in that sentence would be "my n", I want something like that
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sentence Split
« Reply #3 on: October 08, 2005, 11:54:34 AM »
You want the mid, left, and right functions.

I think the syntax is:

left (string, length) = exerpt of the first length characters at the left of string.

Likewise with the others.  Lookup mid's syntax, it's a bit different.
« Last Edit: October 08, 2005, 11:54:49 AM by Numsgil »

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sentence Split
« Reply #4 on: October 08, 2005, 12:43:09 PM »
thx num, that were exacly what I needed. Nums, how do you make a graph like uve done in DB?
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sentence Split
« Reply #5 on: October 08, 2005, 01:43:03 PM »
There isn't an easy way to do it.  I'd check out the graph code in DB.  I didn't program it, but I think it uses line segments...

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sentence Split
« Reply #6 on: October 08, 2005, 02:06:31 PM »
ok, I´ll take a look, but nums, how do you check how long a sentence is in letters, like "hi" is 2 and "hello" is 5 and so on
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sentence Split
« Reply #7 on: October 08, 2005, 02:09:12 PM »
strlen(yourstring)

strlen("hello")  would be 5.

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sentence Split
« Reply #8 on: October 08, 2005, 02:15:10 PM »
thank you
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sentence Split
« Reply #9 on: October 08, 2005, 02:47:39 PM »
hey, it dont work
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sentence Split
« Reply #10 on: October 08, 2005, 03:12:58 PM »
doesn't work how?

Show me what code doesn't work.

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Sentence Split
« Reply #11 on: October 08, 2005, 07:16:23 PM »
its Len("ABCDABC8") will give you 8. Not strlen...

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sentence Split
« Reply #12 on: October 09, 2005, 01:23:23 AM »
ty
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Zelos

  • Bot Overlord
  • ****
  • Posts: 707
    • View Profile
Sentence Split
« Reply #13 on: October 09, 2005, 09:20:44 AM »
how do I make so that when you press a button (like calculate in my simple math program) a another menu apphere instant of the one before. But not so that I have 2 different windows
and another thing, how do I make the program run a sequens of orders every X seconds?
« Last Edit: October 09, 2005, 11:58:39 AM by zelos »
When I have the eclipse cannon under my control there is nothing that can stop me from ruling the world. And I wont stop there. I will never stop conquering worlds through the universe. All the worlds in the universe will belong to me. All the species in on them will be my slaves. THE ENIRE UNIVERSE WILL BELONG TO ME AND EVERYTHING IN IT :evil: AND THERE IS NOTHING ANYONE OF you CAN DO TO STOP ME. HAHAHAHAHAHAHAHA

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Sentence Split
« Reply #14 on: October 09, 2005, 02:19:38 PM »
The "do something every X seconds" involves the timer...  I'm not sure how to do it in VB.  In C it'd be called "multitasking", and you'd set up different threads, and have one sleep for a second then execute...  VB is way different.

When you say another menu, what do you mean?