How to change the sequence of reading DB class ?

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

How to change the sequence of reading DB class ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:10 pm

by hanisoft >> Thu, 18 Jul 2002 1:37:02 GMT

Any datas were stored in any DB class.
for example, 1,2,3,4,p,1,2,3,4,p,... (p means any pictures).

Can I change the sequence of reading ?
(p,1,2,3,4,p,1,2,3,4,... )

thanks you very much.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: How to change the sequence of reading DB class ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:10 pm

by cdshearer >> Thu, 18 Jul 2002 4:23:41 GMT

I'm having trouble understanding exactly what you mean by this. Can you clarify this, perhaps with a concrete example of some JADE code?

Craig

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: How to change the sequence of reading DB class ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:10 pm

by hanisoft >> Thu, 18 Jul 2002 5:34:38 GMT

For example, 2 classes exist.
Question & Maths ( 1 : n relations)
Question 2112.18 Maths 2122.30 (text)
32 (text)
31 (text)
33 (text)
29 (image)
Question 2112.20 Maths 2122.35 (text)
37 (text)
36 (text)
38 (text)
34 (image)
current system reads Question 2112.18 and after that, it references to Math2122.30 / Math2122.32 / Math 2122.31 / Math 2122.33 / Math 2122.29 and then, it continues to Quetion 2112.20 ...
I want to change the sequence of reading for Maths.
29 => 33 => 31 => 32 => 30 & 34 => 38 => 36 => 37 => 35 continue... is it possible ? if so, How can I do it ?

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: How to change the sequence of reading DB class ?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:10 pm

by skipton >> Thu, 18 Jul 2002 17:39:20 GMT
2340: How to change the sequence of reading DB class ?

Hi there,

I have to admit that I'm still not completely sure what is you are asking for help on, in future please try and use clearer examples/wording of what you are trying to achieve so we can respond accordingly.
reading DB class

This sounds like you are reading via something like “Maths.instances”. Most developers find it more useful to declare a root object and define a collection of Maths instances on this class which can then be ordered in whatever way you like?

I'll use a slightly different example, hopefully this is similar to what you are asking for. Consider a set of data which mirrors the layout of a book. A book is broken down into chapters, and then to paragraphs within each chapter. Our Entities(classes) here are Book, Chapter and Paragraph.
For a relationship between these classes, we will define two collections. We can put a ChapterDict (a MemberKeyDictionary with a key of chapterNumber) on Book, and on Chapter we will put a ParagraphArray (to hold the paragraphs for each chapter).
I want to change the sequence of reading

OK, does this mean:

1) you want to display the paragraphs (say in a listbox) in a different order? If you want to read through the paragraphs backwards (reversing your sequence?), there are a number of ways if achieving this

// by looping backwards through the collection
foreach para in chap reversed do
write para.text;
endforeach;

// using iterator.back(para)

// by using the listBox.listCollection showHow property
( refer to the Online Help for this)


2) you want to change the order of the paragraphs for good (persistently) - in the example Ive used this could be as the Books Editor goes through and reorders the paragraphs

For this you need to write a method to update/reorder the paragraphs to reflect the changes. Note that with MemberKeyDictionary’s you can reorder them by changing the “Ascending/Descending” properties as you declare the keys, maybe this is what you are meaning?

Hope this helps.

John Beaufoy


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 18 guests

cron