New call-to-action
Results 1 to 4 of 4

Thread: joining variable name

  1. #1
    Member
    Real Name
    eldon doucette
    Join Date
    Dec 2007
    Posts
    9

    Default joining variable name

    Hi all,
    I would think this would be a simple thing

    i'm doing this in xbasic but using interactive window in code editor to make sure it is doing what I want.

    Dim n1 as c
    n1=abc
    dim i as n
    i=1

    ? (n+i) 'just to keep it simple, how would i print the value of variable n1 in this way, which would say "abc" and not "n1"


    Thanks,
    Eldon

  2. #2
    Member
    Real Name
    Allen Klimeck
    Join Date
    Apr 2000
    Location
    Colorado
    Posts
    549

    Default Re: joining variable name

    dim n1 as c
    n1 ="abc"

    dim i as n
    i=1

    ?eval("n"+i)
    = "abc"

  3. #3
    Member
    Real Name
    eldon doucette
    Join Date
    Dec 2007
    Posts
    9

    Default Re: joining variable name

    Quote Originally Posted by Allen Klimeck View Post
    dim n1 as c
    n1 ="abc"

    dim i as n
    i=1

    ?eval("n"+i)
    = "abc"
    Thanks so much, Allen.
    Appreciate the quick response.
    Have a good one.

    Thanks,
    Eldon

  4. #4
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,739

    Default Re: joining variable name

    dim n as c
    n="abc"

    dim i as n
    i = 1

    ?eval(n+i)
    ERROR: Variable "abc1" not found.

    ?eval("n"+i)
    ERROR: Variable "n1" not found.

    v = n+1
    ?v
    = "abc1"

    v = increment_value(v)
    ?v
    = "ABC2"
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Joining fields
    By deputy956 in forum Alpha Five Version 10 - Desktop Applications
    Replies: 3
    Last Post: 06-01-2016, 03:06 PM
  2. Joining Tables
    By Robyne2006 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 2
    Last Post: 02-16-2013, 06:44 PM
  3. joining tables
    By Katja in forum Alpha Five Version 6
    Replies: 3
    Last Post: 06-12-2005, 06:42 PM
  4. joining database
    By Samer N. Gorial in forum Alpha Four Version 6 and Prior
    Replies: 4
    Last Post: 10-16-2000, 03:31 PM
  5. Joining tables
    By Madelene Ferguson Allen in forum Alpha Five Versions 2 and 3
    Replies: 1
    Last Post: 06-01-2000, 10:43 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
  •