Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

comining 2 indexes inside 1 view
I am trying to reach an view sorted by character field but ended by a
numeric character such as . MY field data looks like that :

AUC2
IDSC3
AUC1
IDSC1
AUC5
IDSC2
AUC3
IDSC4
IDSC5
AUC4

I want my view (dbedit) looks sorted in such way :

AUC1
AUC2
AUC3
AUC4
AUC5
IDSC1
IDSC2
IDSC3
IDSC4
IDSC5


But if I have IDSC10 it comes following to IDSC1 . How can I make
index file sorted based on charater value then index then resort
according to numeric vlaue . I may put both of them in separate fields
.

What a soultion to that problem ?

I am using clipper5 5.01 under Dos (NewPIE) ?

Report this thread to moderator Post Follow-up to this message
Old Post
hpy_awad@yahoo.com
03-27-04 03:58 AM


Re: comining 2 indexes inside 1 view
On 15 Mar 2004 03:10:19 -0800, ehab_aziz2001@yahoo.com
(hpy_awad@yahoo.com) wrote:

>I am trying to reach an view sorted by character field but ended by a
>numeric character such as . MY field data looks like that :
>
>AUC2
>IDSC3
>AUC1
>IDSC1
>AUC5
>IDSC2
>AUC3
>IDSC4
>IDSC5
>AUC4
>
>I want my view (dbedit) looks sorted in such way :
>
>AUC1
>AUC2
>AUC3
>AUC4
>AUC5
>IDSC1
>IDSC2
>IDSC3
>IDSC4
>IDSC5
>
>
>But if I have IDSC10 it comes following to IDSC1 . How can I make
>index file sorted based on charater value then index then resort
>according to numeric vlaue . I may put both of them in separate fields
>.
>
>What a soultion to that problem ?
>
>I am using clipper5 5.01 under Dos (NewPIE) ?

Hi,

Is the last alpha before the numeric always "C" as in your examples?

Regards,

Ross McKenzie
ValuSoft
Melbourne Australia

valusoft AT optushome DOT com DOT au

Report this thread to moderator Post Follow-up to this message
Old Post
Ross McKenzie
03-27-04 03:58 AM


Re: comining 2 indexes inside 1 view
You have to give the second part from the index a fix length :

FIELD1   Character
FIELD2   Digits ,  character field ?

INDEX ON FIELD1 + PADL(ALLTRIM(Field2) , LEN(Field2)  , "0"))

If FIeld2 is numeric , it could be :

PADL(LTRIM(STR(VAL(Field2))) , desired length  , "0")


Frank
"hpy_awad@yahoo.com" <ehab_aziz2001@yahoo.com> schreef in bericht
news:7ecaee57.0403150310.1b04d90d@posting.google.com...
> I am trying to reach an view sorted by character field but ended by a
> numeric character such as . MY field data looks like that :
>
> AUC2
> IDSC3
> AUC1
> IDSC1
> AUC5
> IDSC2
> AUC3
> IDSC4
> IDSC5
> AUC4
>
> I want my view (dbedit) looks sorted in such way :
>
> AUC1
> AUC2
> AUC3
> AUC4
> AUC5
> IDSC1
> IDSC2
> IDSC3
> IDSC4
> IDSC5
>
>
> But if I have IDSC10 it comes following to IDSC1 . How can I make
> index file sorted based on charater value then index then resort
> according to numeric vlaue . I may put both of them in separate fields
> .
>
> What a soultion to that problem ?
>
> I am using clipper5 5.01 under Dos (NewPIE) ?



Report this thread to moderator Post Follow-up to this message
Old Post
Frank Demont
03-27-04 03:58 AM


Re: comining 2 indexes inside 1 view
No . They are abbreivations to library codes. They may be:
ITI1,2,3,..
HTI-OB1,2,3,..
HTI-NB1,2,3,..

etc...

Report this thread to moderator Post Follow-up to this message
Old Post
hpy_awad@yahoo.com
03-27-04 03:58 AM


Re: comining 2 indexes inside 1 view
On 15 Mar 2004 06:28:49 -0800, ehab_aziz2001@yahoo.com
(hpy_awad@yahoo.com) wrote:

>No . They are abbreivations to library codes. They may be:
>ITI1,2,3,..
>HTI-OB1,2,3,..
>HTI-NB1,2,3,..
>
>etc...

OK, then I would probably use the strzero() to reformat your numeric
section of the library code for the index.

Regards,

Ross McKenzie
ValuSoft
Melbourne Australia

valusoft AT optushome DOT com DOT au

Report this thread to moderator Post Follow-up to this message
Old Post
Ross McKenzie
03-27-04 03:58 AM


Re: comining 2 indexes inside 1 view
It can not be given a fixed length as you see my data , but is there a
function detect a foundation of numeric value inside a string ?

Report this thread to moderator Post Follow-up to this message
Old Post
hpy_awad@yahoo.com
03-27-04 03:58 AM


Re: comining 2 indexes inside 1 view

> It can not be given a fixed length as you see my data , but is there a
When you create your 'key' use strzero() - this is what Ross was saying
Eg
key := 'AUC' + strzero( 1, 2 )    // 'AUC01'
key := 'AUC' + strzero( 2, 2 )    // 'AUC02'
key := 'AUC' + strzero( 3, 2 )    // 'AUC02'
key := 'IDSC' + strzero( 1, 2 )    // 'IDSC01'
key := 'IDSC' + strzero( 2, 2 )    // 'IDSC02'
key := 'IDSC' + strzero( 3, 2 )    // 'IDSC03'

That's about the only way you'll be able to sort/index and have 'IDSC10' in 
it's proper place.

--
HTH
Steve Quinn
"hpy_awad@yahoo.com" <ehab_aziz2001@yahoo.com> wrote in message
news:7ecaee57.0403160815.195ab591@posting.google.com...
> It can not be given a fixed length as you see my data , but is there a
> function detect a foundation of numeric value inside a string ?



Report this thread to moderator Post Follow-up to this message
Old Post
Stephen Quinn
03-27-04 03:58 AM


Re: comining 2 indexes inside 1 view
Hi,
"hpy_awad@yahoo.com" <ehab_aziz2001@yahoo.com> a écrit dans le message de
news:7ecaee57.0403160815.195ab591@posting.google.com...
> It can not be given a fixed length as you see my data , but is there a
> function detect a foundation of numeric value inside a string ?

Well, I thing the best way is the following :
1. parse your key, separating the "digit"-parts from the "alpa"-parts
2. pad the "digit"-parts to a sufficient lenght
3. re-assemble the parts to obtain an indexable key
Of course this assume you can add the "patched-for-indexing" field to your
db.

Regards,
Jean-Pierre



Report this thread to moderator Post Follow-up to this message
Old Post
Boss
03-27-04 03:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Clipper archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:07 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.