Alpha Video Training
Results 1 to 5 of 5

Thread: How to get the Ids only using for...Next,

  1. #1
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,077

    Default How to get the Ids only using for...Next,

    Hi


    vWordList= <<%str%
    cat ^01
    dog ^02
    house ^03
    bat ^04
    rat ^05
    mouse ^06
    fish ^07
    %str%

    vCountList = w_count(vWordList,crlf()) ''count the number of words

    FOR i = 1 TO vCountList
    vIds = i+word(vWordList,2,"^")+crlf()

    ui_msg_box("test",""+vIds)
    NEXT i
    How can I get only Ids from the vWordList value?
    This is my result, see attachment.

    for next result.jpg

  2. #2
    "Certified" Alphaholic
    Real Name
    Andrew Schone
    Join Date
    Dec 2005
    Location
    Kansas
    Posts
    1,047

    Default Re: How to get the Ids only using for...Next,

    Code:
    vWordList= <<%str%
    cat ^01
    dog ^02
    house ^03
    bat ^04 
    rat ^05
    mouse ^06
    fish ^07
    %str% 
    
    'vCountList = w_count(vWordList,crlf())	 ''count the number of words
    
    FOR EACH foo in vWordList				
    	vIds = vIds + crlf() + word(foo, 2, "^")
    NEXT	
    
    vIds = remove_blank_lines(vIds)		'remove blank lines
    ui_msg_Box("test",vIds)
    Andrew

  3. #3
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: How to get the Ids only using for...Next,

    Not quite clear on your question, but this is (or some modification thereof) is probably what you need:
    Code:
    dim x as c=""
    vWordList= <<%str%
    cat ^01
    dog ^02
    house ^03
    bat ^04
    rat ^05
    mouse ^06
    fish ^07
    %str%
    
    vCountList = w_count(vWordList,crlf()) ''count the number of words
    
    FOR i = 1 TO vCountList
    x = x+word(word(vWordList,i,crlf()),2,"^")+crlf()
    NEXT i 
    ui_msg_box("test",""+x)

  4. #4
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,077

    Default Re: How to get the Ids only using for...Next,

    Andrew and G

    thank you.
    I'd like to use
    vIds = word(word(vWordList,i,crlf()),2,"^")+crlf()

  5. #5
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,198

    Default Re: How to get the Ids only using for...Next,

    I use this alot getting several record field values from a table delineated (I use double carets - ^^) using table.external_record_content_get() into a variable. When you have one field value of the record, you can get the others with filter_string_smatch(), pulling out one of the other field values of a record using one field value of that record, without having to do a table opening with lookup().

    Code:
     'pretend this list achieved with table.external_record_content_get()
    vWordList= <<%str%      
    cat ^01
    dog ^02
    house ^03
    bat ^04
    rat ^05
    mouse ^06
    fish ^07
    %str%
    
    dim vanimal as C="bat"
    dim vanimal_id as C
    
    vanimal_id=word(filter_string_smatch(vWordList,vanimal+"*",crlf()),2,"^")
    ? vanimal_id
    = "04"
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

Similar Threads

  1. How do I stop look up menus from showing ids?
    By Tanman in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 06-27-2009, 04:27 AM
  2. Better to use numeric or text field for table IDs?
    By keuler in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 11-16-2008, 06:12 PM
  3. Count Duplicate IDs over Period
    By cpc@technonet.com in forum Alpha Five Version 8
    Replies: 4
    Last Post: 05-16-2008, 11:29 AM
  4. Tables With Two IDs
    By George Smyth in forum Alpha Five Version 6
    Replies: 2
    Last Post: 01-13-2005, 12:00 PM
  5. Checking for two IDs
    By George Smyth in forum Alpha Five Version 6
    Replies: 4
    Last Post: 01-12-2005, 08:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •