473,624 Members | 2,119 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

for each statement list compare

I have two listbox arrays 1 dimensional.

They have the same items but in a different order.

Depending on the order of the second newer listbox I'm constructing a
querystring
to sort the order of returned values, select field3, field1, field2, field4
from etc..

What's an easier more logical way to do this which works for 2 values in the
listbox?

If templist.Items. Count = appfields.Items .Count Then

newfieldcount = 0
newfieldorder = 0

Do Until newfieldcount = appfields.Items .Count - 1

If Trim(templist.I tems(newfieldor der)) =
Trim(appfields. Items(newfieldc ount)) Then
If newfieldorder <> appfields.Items .Count Then
fieldstr = fieldstr & "field" &
CStr(newfieldor der + 1) & ", "
End If
newfieldcount = newfieldcount + 1
newfieldorder = 0
End If
newfieldorder = newfieldorder + 1
Loop

fieldstr = fieldstr & "field" & CStr(newfieldor der) & ","
appfields.Items .Clear()
appfields.Items .AddRange(templ ist.Items)
End If
Nov 23 '05 #1
0 813

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1350
by: Glenn Robinson | last post by:
Hello, I have two tables I'm working on: In tableA each row consists of an object, its required status and its current status e.g. Object Req Status Cur Status MYOBJECT1 OK NOTOK
2
1993
by: gssstuff | last post by:
I have a piece of code I use to compare two identically structured tables. There are 15+ sets of tables I am comparing. I am looking to see what has changed between the "old" and "new" versions of the table. Any changes get reported to an audit file which contains the index, field name and field value of the records that have changed. I have the changes nailed for modifications, but cannot seem to get a handle on adds/deletes. Due to...
1
12833
by: Booser | last post by:
// Merge sort using circular linked list // By Jason Hall <booser108@yahoo.com> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> //#define debug
24
5748
by: Robin Cole | last post by:
I'd like a code review if anyone has the time. The code implements a basic skip list library for generic use. I use the following header for debug macros: /* public.h - Public declarations and macros */ #ifndef PUBLIC #define PUBLIC
11
2816
by: Neo | last post by:
Hi Frns, Could U plz. suggest me how can i reverse a link list (without recursion)??? here is my code (incomplete): #include<stdio.h>
4
3589
by: MJ | last post by:
Hi I have written a prog for reversing a linked list I have used globle pointer Can any one tell me how I can modify this prog so that I dont have to use extra pointer Head1. When I reverse a LL using the recursive call how to change the last node pointer to head and head->next to null without using the extra global pointer Mayur
2
1747
by: kevinjbowman | last post by:
I have the following query I wrote in MySQL 5.0 Select eq_employees.empid, eq_sigreturns.returnid From eq_employees Left Join eq_sigreturns ON eq_employees.empid = eq_sigreturns.empid
2
4468
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a generic list populated by a structure and sorts the contents of the list based on the day and project # that is part of the structure. I would like to modify it to also sort on the start time as the third sort parameter? thanks. public class Comparer : IComparer<mergeoutstruct> { public int Compare(mergeoutstruct a, mergeoutstruct b) {
36
2884
by: pereges | last post by:
Hi, I am wondering which of the two data structures (link list or array) would be better in my situation. I have to create a list of rays for my ray tracing program. the data structure of ray looks like this: typedef struct { vector origin; /* vector is an array of 3 doubles */
4
1604
by: MisterE | last post by:
// Is any of this not portable correct etc? #include <stdlib.h> typedef struct b { int f; } B; //Should pointers to pointers be avoided or nothing wrong with this: int compare( const void *arg1, const void *arg2 )
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8677
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8620
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.