473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Logic Help... PLEASE!

Hi guys and Gals I need some serious help please. I can not get my
head around this problem.

At work we have a BBC Acorn computer (yep, I know what yer thinking),
and for the past month I have decided to re-write the software and
replace the Acorn with a p.c. with new software

The BBC is used for displaying callers to the host of a show. But I am
difficulty figuring out how the company wrote a bit of the software.

http://www.ch010a0005.pwp.blueyonder...e/bbcacorn.jpg
Down the left is the Line number, to the right is the Callers Details,
and to the right is the order that they called in on.

So it doesn't matter what line they call in on, they will always get
the next available letter. But when you delete the caller the letter
is taken away and then given to the next letter.

So if you delete Line 1. Marc-Coat-Football A
then Donald-Glas-Oneil then loses the B and becomes A,
Dougie-Dundee-Hibs then loses the C and becomes B,
etc. etc.

My GUI looks like this:

[img:9e2f161115]http://www.ch010a0005.pwp.blueyonder.co.uk/extreme/1.jpg[/img:9e2f161115]

Where the Yellow Diamonds are, is where I want to place the letters.
The Diamonds are just labels with an imagebackground.

Any help in figuring out the logic to the letters is much appreciated.
I have been sat for the past 5 hours trying to figure out how to
accomplish this.

Thanks for reading, and hopefully your help.

Chris

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #1
5 2034
Well, congratulations on having the fantastic luck to be working on a
replacement of a BBC Acorn. I really cannot beleive this is happening in
2004, almost twenty years after they stopped production of this model.
Amazing. However.

PSEUDO CODE

'When Caller is Deleted

For Each Caller In CallerCollection

Decrement Caller Letter by one, IE if Letter is B, then B becomes A

.....

Regards - OHM







ukjock wrote:
Hi guys and Gals I need some serious help please. I can not get my
head around this problem.

At work we have a BBC Acorn computer (yep, I know what yer thinking),
and for the past month I have decided to re-write the software and
replace the Acorn with a p.c. with new software

The BBC is used for displaying callers to the host of a show. But I am
difficulty figuring out how the company wrote a bit of the software.

http://www.ch010a0005.pwp.blueyonder...e/bbcacorn.jpg
Down the left is the Line number, to the right is the Callers Details,
and to the right is the order that they called in on.

So it doesn't matter what line they call in on, they will always get
the next available letter. But when you delete the caller the letter
is taken away and then given to the next letter.

So if you delete Line 1. Marc-Coat-Football A
then Donald-Glas-Oneil then loses the B and becomes A,
Dougie-Dundee-Hibs then loses the C and becomes B,
etc. etc.

My GUI looks like this:

[img:9e2f161115]http://www.ch010a0005.pwp.blueyonder.co.uk/extreme/1.jpg[/im
g:9e2f161115]
Where the Yellow Diamonds are, is where I want to place the letters.
The Diamonds are just labels with an imagebackground.

Any help in figuring out the logic to the letters is much appreciated.
I have been sat for the past 5 hours trying to figure out how to
accomplish this.

Thanks for reading, and hopefully your help.

Chris

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet
News==---- http://www.newsfeed.com The #1 Newsgroup Service in the
World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized
Servers - Total Privacy via Encryption =---


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #2
Oh yeah, you will need a last letter Static Variable to keep a record of
your last used Letter.

So . . . .

DeleteCaller( CallerName )
' Delete Caller
' Decrement All Letters
' Should Decrement Last Letter

AddCaller( CallerName )
' AddName Using Last Letter
' IncrementLastLetterUsed

Regards - OHM

One Handed Man [ OHM# ] wrote:
Well, congratulations on having the fantastic luck to be working on a
replacement of a BBC Acorn. I really cannot beleive this is happening
in 2004, almost twenty years after they stopped production of this
model. Amazing. However.

PSEUDO CODE

'When Caller is Deleted

For Each Caller In CallerCollection

Decrement Caller Letter by one, IE if Letter is B, then B becomes
A

....

Regards - OHM







ukjock wrote:
Hi guys and Gals I need some serious help please. I can not get my
head around this problem.

At work we have a BBC Acorn computer (yep, I know what yer thinking),
and for the past month I have decided to re-write the software and
replace the Acorn with a p.c. with new software

The BBC is used for displaying callers to the host of a show. But I
am difficulty figuring out how the company wrote a bit of the
software.

http://www.ch010a0005.pwp.blueyonder...e/bbcacorn.jpg
Down the left is the Line number, to the right is the Callers
Details, and to the right is the order that they called in on.

So it doesn't matter what line they call in on, they will always get
the next available letter. But when you delete the caller the letter
is taken away and then given to the next letter.

So if you delete Line 1. Marc-Coat-Football A
then Donald-Glas-Oneil then loses the B and becomes A,
Dougie-Dundee-Hibs then loses the C and becomes B,
etc. etc.

My GUI looks like this:

[img:9e2f161115]http://www.ch010a0005.pwp.blueyonder.co.uk/extreme/1.jpg[/im g:9e2f161115]

Where the Yellow Diamonds are, is where I want to place the letters.
The Diamonds are just labels with an imagebackground.

Any help in figuring out the logic to the letters is much
appreciated. I have been sat for the past 5 hours trying to figure
out how to accomplish this.

Thanks for reading, and hopefully your help.

Chris

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet
News==---- http://www.newsfeed.com The #1 Newsgroup Service in the
World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized
Servers - Total Privacy via Encryption =---


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #3

Hello Chris

Check out the code below. It provides the functionality you needed. Also
there is test code that you can plop onto a form with a listbox and a button
on it.
--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx
"ukjock" <th*******@aol-dot-com.no-spam.invalid> wrote in message
news:3f**********@127.0.0.1...
Hi guys and Gals I need some serious help please. I can not get my
head around this problem.

At work we have a BBC Acorn computer (yep, I know what yer thinking),
and for the past month I have decided to re-write the software and
replace the Acorn with a p.c. with new software

The BBC is used for displaying callers to the host of a show. But I am
difficulty figuring out how the company wrote a bit of the software.

http://www.ch010a0005.pwp.blueyonder...e/bbcacorn.jpg
Down the left is the Line number, to the right is the Callers Details,
and to the right is the order that they called in on.

So it doesn't matter what line they call in on, they will always get
the next available letter. But when you delete the caller the letter
is taken away and then given to the next letter.

So if you delete Line 1. Marc-Coat-Football A
then Donald-Glas-Oneil then loses the B and becomes A,
Dougie-Dundee-Hibs then loses the C and becomes B,
etc. etc.

My GUI looks like this:

[img:9e2f161115]http://www.ch010a0005.pwp.blueyonder.co.uk/extreme/1.jpg[/im
g:9e2f161115]
Where the Yellow Diamonds are, is where I want to place the letters.
The Diamonds are just labels with an imagebackground.

Any help in figuring out the logic to the letters is much appreciated.
I have been sat for the past 5 hours trying to figure out how to
accomplish this.

Thanks for reading, and hopefully your help.

Chris

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---
Public Class clsCaller

'================================

'very simple class for holding

'caller information

'================================

Private _Callername As String

Private _CalllerLine As Integer

Private _CallerQue As Char

'constructor requires a name and the line number

Public Sub New(ByVal Name As String, ByVal Line As Integer)

Me._Callername = Name

Me._CalllerLine = Line

End Sub

Public Property CallerName() As String

Get

Return Me._Callername

End Get

Set(ByVal Value As String)

Me._Callername = Value

End Set

End Property

Public Property CallerLine() As Integer

Get

Return Me._CalllerLine

End Get

Set(ByVal Value As Integer)

Me._CalllerLine = Value

End Set

End Property

Public Property CallerQueue() As Char

Get

Return Me._CallerQue

End Get

Set(ByVal Value As Char)

Me._CallerQue = Value

End Set

End Property

End Class

Public Class clsCallers : Implements IEnumerable

Dim _MyCallers As New ArrayList(25)

'adds a caller to the que

Public Function AddCaller(ByVal Name As String, ByVal Line As Integer)

Me._MyCallers.Add(New clsCaller(Name, Line))

End Function

'removes a caller from the que

Public Sub RemoveCaller(ByVal Caller As clsCaller)

Me._MyCallers.Remove(Caller)

End Sub

'gets a caller from the list by index

Public Overloads ReadOnly Property Caller(ByVal Index As Integer) As
clsCaller

Get

Dim MyCaller As clsCaller = DirectCast(Me._MyCallers(Index), clsCaller)

MyCaller.CallerQueue = Chr(65 + Index)

Return MyCaller

End Get

End Property

'gets a caller by queue letter

Public Overloads ReadOnly Property Caller(ByVal Queue As Char) As clsCaller

Get

Queue = Queue.ToUpper(Queue)

If Queue >= "A" Or Queue <= "Z" Then

Return Me._MyCallers(Asc(Queue) - 65)

End If

End Get

End Property

'this makes the Callers class enumerable. So you can get each caller element
in a For-Each structure

Public Function GetEnumerator() As System.Collections.IEnumerator Implements
System.Collections.IEnumerable.GetEnumerator

Return New CallerCollection(Me._MyCallers)

End Function

End Class

'this class provides the enumeration capability for the Callers class

Class CallerCollection : Implements IEnumerator

Private _MyCallers As ArrayList

Private _Index As Integer = -1

Public Sub New(ByVal Callers As ArrayList)

Me._MyCallers = Callers

End Sub

Public ReadOnly Property Current() As Object Implements
System.Collections.IEnumerator.Current

Get

Dim MyCaller As clsCaller = DirectCast(Me._MyCallers(Me._Index), clsCaller)

MyCaller.CallerQueue = Chr(65 + Me._Index)

Return MyCaller

End Get

End Property

Public Function MoveNext() As Boolean Implements
System.Collections.IEnumerator.MoveNext

If Me._Index >= Me._MyCallers.Count - 1 Then Return False

Me._Index += 1

Return True

End Function

Public Sub Reset() Implements System.Collections.IEnumerator.Reset

Me._Index = 0

End Sub

End Class

Drop this code in a form that has a listbox and a command button

Private _Mycallers As clsCallers

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Me._Mycallers = New clsCallers

With Me._Mycallers

..AddCaller("Joe Caller", 1)

..AddCaller("Bill Called", 2)

..AddCaller("Harry Calling", 3)

..AddCaller("Mary Online", 4)

End With

For Each MyCaller As clsCaller In Me._Mycallers

Me.ListBox1.Items.Add(MyCaller.CallerLine & vbTab & MyCaller.CallerQueue &
vbTab & MyCaller.CallerName)

Next

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim Caller As clsCaller

Caller = Me._Mycallers.Caller(1)

Me._Mycallers.RemoveCaller(Caller)

Me.ListBox1.Items.Clear()

For Each MyCaller As clsCaller In Me._Mycallers

Me.ListBox1.Items.Add(MyCaller.CallerLine & vbTab & MyCaller.CallerQueue &
vbTab & MyCaller.CallerName)

Next

End Sub


Nov 20 '05 #4
I believe that In the Button1_Click Event

Caller = Me._Mycallers.Caller(1)

should be (zero based arrays)

Caller = Me._Mycallers.Caller(0)
Also Me._MyCallers(Asc(Queue) - 65) needs a DirectCast (per Option Strict)
Public Overloads ReadOnly Property Caller(ByVal Queue As Char) As
clsCaller

Get

Queue = Queue.ToUpper(Queue)

If Queue >= "A" Or Queue <= "Z" Then

Return DirectCast(Me._MyCallers(Asc(Queue) - 65), clsCaller)

End If

End Get

End Property

"IbrahimMalluf" <Ib*****@malluf.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...

Hello Chris

Check out the code below. It provides the functionality you needed. Also
there is test code that you can plop onto a form with a listbox and a button on it.
--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx
"ukjock" <th*******@aol-dot-com.no-spam.invalid> wrote in message
news:3f**********@127.0.0.1...
Hi guys and Gals I need some serious help please. I can not get my
head around this problem.

At work we have a BBC Acorn computer (yep, I know what yer thinking),
and for the past month I have decided to re-write the software and
replace the Acorn with a p.c. with new software

The BBC is used for displaying callers to the host of a show. But I am
difficulty figuring out how the company wrote a bit of the software.

http://www.ch010a0005.pwp.blueyonder...e/bbcacorn.jpg
Down the left is the Line number, to the right is the Callers Details,
and to the right is the order that they called in on.

So it doesn't matter what line they call in on, they will always get
the next available letter. But when you delete the caller the letter
is taken away and then given to the next letter.

So if you delete Line 1. Marc-Coat-Football A
then Donald-Glas-Oneil then loses the B and becomes A,
Dougie-Dundee-Hibs then loses the C and becomes B,
etc. etc.

My GUI looks like this:

[img:9e2f161115]http://www.ch010a0005.pwp.blueyonder.co.uk/extreme/1.jpg[/im g:9e2f161115]

Where the Yellow Diamonds are, is where I want to place the letters.
The Diamonds are just labels with an imagebackground.

Any help in figuring out the logic to the letters is much appreciated.
I have been sat for the past 5 hours trying to figure out how to
accomplish this.

Thanks for reading, and hopefully your help.

Chris

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption =---
Public Class clsCaller

'================================

'very simple class for holding

'caller information

'================================

Private _Callername As String

Private _CalllerLine As Integer

Private _CallerQue As Char

'constructor requires a name and the line number

Public Sub New(ByVal Name As String, ByVal Line As Integer)

Me._Callername = Name

Me._CalllerLine = Line

End Sub

Public Property CallerName() As String

Get

Return Me._Callername

End Get

Set(ByVal Value As String)

Me._Callername = Value

End Set

End Property

Public Property CallerLine() As Integer

Get

Return Me._CalllerLine

End Get

Set(ByVal Value As Integer)

Me._CalllerLine = Value

End Set

End Property

Public Property CallerQueue() As Char

Get

Return Me._CallerQue

End Get

Set(ByVal Value As Char)

Me._CallerQue = Value

End Set

End Property

End Class

Public Class clsCallers : Implements IEnumerable

Dim _MyCallers As New ArrayList(25)

'adds a caller to the que

Public Function AddCaller(ByVal Name As String, ByVal Line As Integer)

Me._MyCallers.Add(New clsCaller(Name, Line))

End Function

'removes a caller from the que

Public Sub RemoveCaller(ByVal Caller As clsCaller)

Me._MyCallers.Remove(Caller)

End Sub

'gets a caller from the list by index

Public Overloads ReadOnly Property Caller(ByVal Index As Integer) As
clsCaller

Get

Dim MyCaller As clsCaller = DirectCast(Me._MyCallers(Index), clsCaller)

MyCaller.CallerQueue = Chr(65 + Index)

Return MyCaller

End Get

End Property

'gets a caller by queue letter

Public Overloads ReadOnly Property Caller(ByVal Queue As Char) As clsCaller
Get

Queue = Queue.ToUpper(Queue)

If Queue >= "A" Or Queue <= "Z" Then

Return Me._MyCallers(Asc(Queue) - 65)

End If

End Get

End Property

'this makes the Callers class enumerable. So you can get each caller element in a For-Each structure

Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator

Return New CallerCollection(Me._MyCallers)

End Function

End Class

'this class provides the enumeration capability for the Callers class

Class CallerCollection : Implements IEnumerator

Private _MyCallers As ArrayList

Private _Index As Integer = -1

Public Sub New(ByVal Callers As ArrayList)

Me._MyCallers = Callers

End Sub

Public ReadOnly Property Current() As Object Implements
System.Collections.IEnumerator.Current

Get

Dim MyCaller As clsCaller = DirectCast(Me._MyCallers(Me._Index), clsCaller)
MyCaller.CallerQueue = Chr(65 + Me._Index)

Return MyCaller

End Get

End Property

Public Function MoveNext() As Boolean Implements
System.Collections.IEnumerator.MoveNext

If Me._Index >= Me._MyCallers.Count - 1 Then Return False

Me._Index += 1

Return True

End Function

Public Sub Reset() Implements System.Collections.IEnumerator.Reset

Me._Index = 0

End Sub

End Class

Drop this code in a form that has a listbox and a command button

Private _Mycallers As clsCallers

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Me._Mycallers = New clsCallers

With Me._Mycallers

.AddCaller("Joe Caller", 1)

.AddCaller("Bill Called", 2)

.AddCaller("Harry Calling", 3)

.AddCaller("Mary Online", 4)

End With

For Each MyCaller As clsCaller In Me._Mycallers

Me.ListBox1.Items.Add(MyCaller.CallerLine & vbTab & MyCaller.CallerQueue &
vbTab & MyCaller.CallerName)

Next

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim Caller As clsCaller

Caller = Me._Mycallers.Caller(1)

Me._Mycallers.RemoveCaller(Caller)

Me.ListBox1.Items.Clear()

For Each MyCaller As clsCaller In Me._Mycallers

Me.ListBox1.Items.Add(MyCaller.CallerLine & vbTab & MyCaller.CallerQueue &
vbTab & MyCaller.CallerName)

Next

End Sub

Nov 20 '05 #5
"ukjock" <th*******@aol-dot-com.no-spam.invalid> wrote...
Down the left is the Line number, to the right is the Callers Details,
and to the right is the order that they called in on.

So it doesn't matter what line they call in on, they will always get
the next available letter. But when you delete the caller the letter
is taken away and then given to the next letter.


I note that you received replies but may I suggest that there may be a
design flaw. The user scans the list looking for the letter "A" on the
right (somewhere) and then they choose a line on a phone using the number on
the left.

Shouldn't they rather be being told which line to pickup next? The thing is
a queue... you simply eliminate the letter and always add the caller's name
and the phone line to the end of the queue as they call in. Now even if you
had 30 or 300 phone lines nobody scans anything, they simply look at the
first entry and choose that line.

From a solutions standpoint, using letters means you're locked into 26
entries max but more importantly the user has to find the next one. That's
what computers are for :-)
Tom
Nov 20 '05 #6

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

Similar topics

0
by: radha | last post by:
Hai all, My problem not just releated to sql. My problem is releated to good logic. I should not this type of questions hear. But just i am trying. If any body gave suggestions, or help i am...
2
by: Andreas Schmitt | last post by:
Hi, Sorry for posting in German before, totally forgot about that when I was pasting this in here from another German newsgroup I was writing to, trying to get help I am programming a simple...
7
by: Stephen | last post by:
I have some code which I call from a custom validator however I seem to have got the logic wrong and im having trouble figuring out how to write my code to get things to work the way I require....
5
by: Nate | last post by:
We are attempting to make a request to a web service (we will refer to it as XXXServices) hosted on a Web Logic server from a C# SOAP client. The server responds with a 401 Unauthorized error...
2
by: netasp | last post by:
hi all, I need your help with the following scenario: I am using VS 2005 and SQL server DB, my form has 3 textboxes txtTotalAmount, txtAmountEntered, txtAmountBalance. If txtTotalAmount is...
15
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to...
2
by: nsharish20 | last post by:
Hi, I have a sensor in the shape of a small circle and a hole which is larger than the sensor circle. Basically i have a small circle and a large circle. Now i would like to check these...
1
by: jonathan184 | last post by:
how to monitor and find out if files test1_* and test2_* files were sent in an hour and if not send an email This is on a unix system basically I got a cronjob that runs every sec polling a ftp dir...
9
by: SAL | last post by:
Hello, I have a Dataset that I have table adapters in I designed using the designer (DataLayer). I have a business logic layer that immulates the DataLayer which may/may not have additional logic...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.