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

  • Home
  • SEARCH
  • 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 708759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:25:37+00:00 2026-05-14T04:25:37+00:00

In short, currently I am using the following code to pull records from multiple

  • 0

In short, currently I am using the following code to pull records from multiple tables in a Sqlite Db and insert them in a single combobox ($SearchBar):

set SrchVals1 [db eval {SELECT DISTINCT Stitle From Subcontract Order By Stitle ASC}]
set SrchVals2 [db eval {...
set SrchVals3 ...
set SrchValsALL [concat $SrchVals1 $SrchVals2 $SrchVals3]
$SearchBar configure -value $SrchValsAll

For the variable “SrchVals1”, I am trying to figure out a way to concatenate the text “Sub: ” to each individual record in SrchVals1. For example, if SrchVals1 shows the following records in the combobox:

First Title
Second Title
Third Title

I would like to concatenate so that the records in the combobox look like this:

Sub: First Title
Sub: Second Title
Sub: Third Title

I understand that I might have to use a foreach statement; however, I am having no luck writing one that adds “Sub: ” in front of each record, as opposed to one. This seems like something that should be pretty easy, but I cannot seem to figure it out.

Does anyone know how I can achieve these results?

Thank you,

DFM

  • 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-05-14T04:25:38+00:00Added an answer on May 14, 2026 at 4:25 am

    You’re right. The foreach command is the right way to do it. Here’s how:

    set SrchValsALL {}
    foreach value [concat $SrchVals1 $SrchVals2 $SrchVals3] {
        lappend SrchValsALL "Sub: $value"
    }
    $SearchBar configure -value $SrchValsAll
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a very short project on Prolog, and just got stuck
The Wikipedia article on Effect system is currently just a short stub and I've
Short: how does modelbinding pass objects from view to controller? Long: First, based on
In short: How do you specify a BIGINT in Django models? In a current
Short version: I want to trigger the Form_Load() event without making the form visible.
Short version: I'm wondering if it's possible, and how best, to utilise CPU specific
Short of cutting and pasting, is there a way to sort the methods in
Short of putting a UIWebView as the back-most layer in my nib file, how
Short version: assuming I don't want to keep the data for long, how do
I'm trying to trouble shoot a web service client in my current project. I'm

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.