Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9267979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:41:25+00:00 2026-06-18T14:41:25+00:00

Alright, I need help here. I have done this before where you have variable1

  • 0

Alright, I need help here. I have done this before where you have variable1 (let’s say it’s eat1=apple), variable2 (this is eat2=orange), and variable3 (appaleorange=apple and orange). I need it to do this:

    echo Apple:%eat1%
    echo Orange:%eat2%
    echo Apple & Orange:%eat1%%eat2%

Now, you can see my problem. That above script wouldn’t show the word and, only appleorange. That isn’t my script and the reason I need this is because I have multiple variables with numbers in them. I have done this before and I forgot how… I know you can do a call and then multiple %’s.

In this case I want fterm variable to be fterm (not sure how to have it in there and not be a variable) and stermnum as a number that will be changed often on other parts of the script.

My code:

    set stermnum=1
    call set exsternum=%%fterm%%stermnum%%%
    echo Selected term:%stermnum% ^(%exsternum%^)

Does anyone know what to do?
Thanks and sorry it was long 😛

~Edit:I found it out… If it helps anyone I did:
call set exsternum=%%fterm%stermnum%%

Sorry for posting this even though I figured it out so fast

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:41:26+00:00Added an answer on June 18, 2026 at 2:41 pm

    The OP appended a solution to the question, but it does not relate to the original question scenario, and it still has a bug.

    Here is the OP’s solution in terms of the original scenario:

    set "eat1=apple"
    set "eat2=orange"
    set "appleorange=apple and orange"
    call echo %%%eat1%%eat2%%%
    

    For the actual code, I believe the OP wants to access an array of variables named fterm1, fterm2, fterm3, etc. And the number suffix is in a variable named stermnum.

    call set exsternum=%%fterm%stermnum%%%
    

    If fterm is itself a variable containing the base name of the array, then the solution becomes:

    call set exsternum=%%%fterm%%stermnum%%%
    

    But CALL is inefficient – Probably not noticeable with a single CALL, but it becomes painfully slow if executed thousands of times in a loop.

    There is a much faster solution using delayed expansion. Delayed expansion must be enabled prior to being used.

    Original scenario:

    setlocal enableDelayedExpansion
    set "eat1=apple"
    set "eat2=orange"
    set "appleorange=apple and orange"
    echo !%eat1%%eat2%!
    

    Actual code, interpretation 1:

    setlocal enableDelayedExpansion
    REM additonal code ...
    set exsternum=!fterm%stermnum%!
    

    Actual code, interpretation 2:

    setlocal enableDelayedExpansion
    REM additonal code ...
    set exsternum=!%fterm%%stermnum%!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, let's say I have these two tables: items with columns id, stuff item_properties
Alright, I'm starting to pull my hair and I need some help :) Here
Alright zeroclipboard experts, I need some help. I have a popup context menu and
Alright, need some help created a query for an Oracle 10g DB. I have
Alright, i need to make a string defined as rootString that looks like this:
Alright simple question I have integriters like 5 188 4634 And they all need
Alright I don't see why this isnt working. It seems pretty simple. Here is
Alright so i have been working on this Dynamic load of a spinner from
I need your help, i'm stacked on this project. When i run my applicaion
Alright guys, Need some help! Im working with asp.net mvc3 razor (and am fairly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.