Question...

Discussion in 'Programming General' started by Visual Basic Matt, Nov 15, 2008.

Question...
  1. Unread #1 - Nov 15, 2008 at 5:44 PM
  2. Visual Basic Matt
    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056

    Visual Basic Matt Apprentice

    Question...

    Ok,I'm not sure how to do so, so here's my question...

    If I has a text with a list of different items,

    So basicly what I want is this...
    For example...
    If there was a text like this below
    Code:
    Show-MyUsername
    But the program wants to add to the list the information after,
    "Show-" Then, add the text after that to the list...
    Another example would be...
    Code:
    Prompt[Information]
    Adding to the list whats in between the "[" and the other "]"

    Thanks, I take all the help I can get, I really appreciate it.
     
  3. Unread #2 - Nov 15, 2008 at 10:52 PM
  4. jdsfighter
    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0

    jdsfighter Forum Addict
    Visual Basic Programmers

    Question...

    Well here are a couple of methods I just free handed, I don't have vb on this system, but this should get you started

    Code:
    Private Function ExtractShow(sText as string) as string
    Dim Pos as integer
    
    Pos=instr(1,sText,"Show-")+5
    
    ExtractShow=Mid(sText,Pos)
    End Function
    Here is for prompt
    Code:
    Private Function ExtractPrompt(sText as string) as string
    Dim Pos(1) as integer
    
    Pos(0)=instr(1,sText,"Prompt(")+7
    Pos(1)=instr(pos(0),sText,")")
    
    ExtractPrompt=Mid(sText,pos(0),pos(1)-pos(0))
    End Function
     
  5. Unread #3 - Nov 16, 2008 at 8:14 AM
  6. Visual Basic Matt
    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056

    Visual Basic Matt Apprentice

    Question...

    Ok thanks, I'll see what I can do...
     
  7. Unread #4 - Nov 17, 2008 at 5:37 PM
  8. jdsfighter
    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0

    jdsfighter Forum Addict
    Visual Basic Programmers

    Question...

    For the record, I tested both functions on my system and both work fine.
     
< Python 2.6 (Saving Scripts) | visual c++ tools for ubuntu >

Users viewing this thread
1 guest


 
 
Adblock breaks this site