Adblock breaks this site

Question...

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

  1. Visual Basic Matt

    Visual Basic Matt Apprentice

    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056
    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.
     
  2. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    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
     
  3. Visual Basic Matt

    Visual Basic Matt Apprentice

    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056
    Question...

    Ok thanks, I'll see what I can do...
     
  4. jdsfighter

    jdsfighter Forum Addict
    Visual Basic Programmers

    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0
    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 >


 
 
Adblock breaks this site