LizR 171 Posting Virtuoso

Before I even look at the code (its late and I'd probably talk rot if I started to understand anyone elses code right now - bad day, too much on mind.. bleh)

If you had a picture as class, which allowed moving (as zoomed in you see less of the picture etc) you would have

current rect viewport - area of pic to display
current scale

So, when the pic zooms in you use the scale to select a relevant size box centred over either the click on the picture or the centre of the box..

move will tell you how much to move in conjunction with the scale

zoom out does kinda the same only of course it means you see a bigger area of the original image..

The math still seems relatively simple to me.. should I be raiding the teapot (dont drink coffee) again?

LizR 171 Posting Virtuoso

Does your picture get moved around within the picture box? otherwise, Im not sure why else you wouldnt stuggle with working out where you clicked on your picture.

LizR 171 Posting Virtuoso

OK, but how would you have made a sub in vb, to send it say 2 parameters, and return the sum of them as a result?

(c# while different is not as hugely different in this respect)

LizR 171 Posting Virtuoso

OK, under ASP you'd most likely have used vb, did you ever make subs then?

LizR 171 Posting Virtuoso

Well if you were going to do that you would need to pass product to your read input, as well as then having properties you would read it into.

Which goes back to my earlier questions

LizR 171 Posting Virtuoso

Triggers serve a purpose, and if it was a lowish transaction base, then Id say go for it. Triggers if setup incorrectly can cause havoc in terms of recursion, stack, network bandwidth, disk bandwidth, cpu etc.. depending on what you do with them.

By writing a kinda batch system, that runs through and looks for updates, you can seriously throttle and control how much how often etc, and this is often key.. after all, if something goes wrong and your triggers gone recursive... only option is to down the db, and potentially waste time trying to repair it.. depending on size, this could be hours.. (one guy dumped a table where I work by mistake, took 47 hours to recover for example) where as, again, an outside batching/searching system if it starts playing up.. You kill it. Job done.

LizR 171 Posting Virtuoso

I will be more than happy if you help me with one or two of the variables so I can fill out the rest and post it back here. I have trying this for days and I am not not use to C# at all. Frustrating :-)

That sounds like someone whos coded in something else? Is this the case?

LizR 171 Posting Virtuoso

OK, so you havent worked out the placing of parameters into functions - thats a very fundemental thing. If you do look through most of the code on this site you'll find some examples of user made functions that have parameters, and how to return values (theres some hints in there you know!)

You've done pretty well, in fact you've already used some parameters and prebuilt functions, you just need to take the next step of making your own.

LizR 171 Posting Virtuoso

If you need it done for each and every update, triggers are pretty much the only way to do it, but you dont have any method to throttle it.

If you can bear to batch it, then trigger the batch check every x minutes. You can do so.

LizR 171 Posting Virtuoso

That will be why then, your textFile1_paras is null. You havent initialised it.

LizR 171 Posting Virtuoso

probably because you dont check that paraNumber < than the number of available lines. (eg you havent shown where you set textFile1_paras, as an array, it may not be big enough

LizR 171 Posting Virtuoso

Or, in a more OO term you would either set the property of the second form - which has an associated event to triger the change in form 2.

LizR 171 Posting Virtuoso

Thats a whole new question :P make a new thread of it, and mark this one as solved.

LizR 171 Posting Virtuoso

Finally :p

now mark it as solved :)

LizR 171 Posting Virtuoso

Glad you found it then - and please mark it as solved!

LizR 171 Posting Virtuoso

Change to multiline text boxes?

LizR 171 Posting Virtuoso

All your 3 options would have to descend from the same class. Much as you descend from your parents, classes descend from things, currently if you say nothing else TObject. So while you could then cast your tobject and assign an instance of your item, it would be hard to work with.

LizR 171 Posting Virtuoso

The classes would need to share a parent to do that and all be descended from the parent

LizR 171 Posting Virtuoso

Pressing F1 on a component will take you to the MSDN help which has examples, its really not overly hard

LizR 171 Posting Virtuoso

The difference is the

= +1
is the same as =1
where as

+= 1

will add one and store it.

Typos FTW

LizR 171 Posting Virtuoso

We were - but the method chosen kinda works, except its a little more confused :)

LizR 171 Posting Virtuoso

Dont forget then to mark this as solved

LizR 171 Posting Virtuoso

The problem is you're assuming your authority is passed on, programattically it wont, you need to do that for it. Try your code out to start with locally.. before worrying about other machines.

LizR 171 Posting Virtuoso

Ok, one thing that does puzzle me is

private void ShowSld(int sldCnt)
        {

            int xPos = 10;// 140;
            int yPos = 23;// 140;
            this.groupBox2.Controls.Clear();
            while (n < sldCnt)
            {
                    sldArray[n].Tag = n;
                    sldArray[n].Width = 125;
                    sldArray[n].Height = 115;
                    if (xPos > 570)
                    {
                        xPos = 10;
                        yPos = yPos + sldArray[n].Height + 35;
                    }
                    sldArray[n].Left = xPos;
                    sldArray[n].Top = yPos;
                    xPos = xPos + sldArray[n].Width + 15;

                    groupBox2.Controls.Add(sldArray[n]);
                    sldArray[n].FileName = filCol[n].FullName;

                    n++;
            }
         }

At face value, it would seem the start variable should work out but then you dont seem to use it in your actual display.. and you rely on "n" which could get changed in a number of places, but, the while loop would at least end at the right end..

You might want to tweak that so it maybe has a more reliable output - as for example, if you displayed page 3, and selected a slide, n goes back to 0.

use of local variables would overcome the concerns about last state, but it would be easier to pass a start+end variable pair to your function as a result.

LizR 171 Posting Virtuoso

So, you didnt really read the huge hints everyone gave you then

LizR 171 Posting Virtuoso

Wherever the code is run.
So, unless you use .net remoting for a windows/mono app then most likely its on the client. But if you're talking asp.net (theres a forum for that) it would be the server end..

LizR 171 Posting Virtuoso

Because its happening so fast the seed is the same for all.
move the

Random losowanie = new Random();

to outside the function so its not recreated each time, so its a private variable to your class. You should get different numbers then.

LizR 171 Posting Virtuoso

the programming language has nothing to do with it. You didnt even do much to work out the logic - everyone else did it for you.

Try.
I've seen enough of your code to know you can do it

LizR 171 Posting Virtuoso

Given the amount of hints people have given you give it a go, if something this simple baffles you what are you going to do with a big problem?

LizR 171 Posting Virtuoso

You should be able to do it (as that was the point of the db challenge I set for the guys there)

You can create it and delete it when your done :) Without checking (its late) Im fairly sure you can do it totally in memory - although there are memory table components

LizR 171 Posting Virtuoso

Yes and no.
Its a CBuilder item, and its specific to CBuilder. So it has something in c++ code (or you wouldnt be changing the c++ compile settings)

Knowing you have access to that makes a huge difference, as if you only owned Delphi 2009 (which is very plausable) you wouldnt have been able to recompile and change it.. where as you could still actually use it.

LizR 171 Posting Virtuoso

OK, but thats only true if your stuff uses and rebuilds c++ and you said you had delphi 2009, not studio..

LizR 171 Posting Virtuoso

clientdataset can be very easily used without a table:

Take a read of : http://www.3dbuzz.com/vbforum/showthread.php?t=152078 where how to set one up is kinda explained a little

LizR 171 Posting Virtuoso

cc3290mt.dll is a c builder file - dunno what it does, never really got into c builder - so, Im guessing you're using a 3rd party component, which means if you ditched the thing requiring the cc3290mt.dll, you ditch the borlandmm.dll too

LizR 171 Posting Virtuoso

cc3290mt.dll isnt a default codegear/borland/embarcadero component, so its possible that its reliant on it because of that. the Borlndmm.dll is required because your other dll is most likely using it as well as sharing memory in your app (eg it passes strings not pchars)

LizR 171 Posting Virtuoso

Because you compiled it with runtime libraries - if you go the project options and turn it off. you wont.

LizR 171 Posting Virtuoso

Do you now see how to do the code?

LizR 171 Posting Virtuoso

So, we've kinda proved you need a rethink.
Have another go - the answer will come, honest.

LizR 171 Posting Virtuoso

ok so if n is page, 1, N+15 = 16, so thats the start of page 2, not the start of page 1.....

So, still using N, what would be the beginning and end of page 1?

LizR 171 Posting Virtuoso

Well then just use panels, and you can have next and back buttons at the bottom or whatever suits you

LizR 171 Posting Virtuoso

You can use panels and have buttons instead

LizR 171 Posting Virtuoso

Dont ask me :)
Please make sure you mark it as closed

LizR 171 Posting Virtuoso

Without seeing the code for that the fact it says "@\"C:\\Test\"" for example, implies its encoding the whole @"C:\Test" as the filename, which is correct. " marks etc arent a valid file name, while c:\test can be.

If you're entering the path in a text box, dont enter the @ or " marks

LizR 171 Posting Virtuoso

OK, but that wasnt the question. That tells you how many pages there are, not how you tell which ones to give in a mathematical equation. Sigh.

If you were counting on your fingers, 6 would be the first finger your hand (wether you used the same hand or both). So, if you had "15" fingers per hand, how would you work out mathematically which finger any given number is, if I said you had counted your hand 12 times, which numbers would you be on..

displaying the images is the same.

LizR 171 Posting Virtuoso

Well, as I said before in your other thread theres 2 ways, 1 involves a bit of maths the other involves messier code. However, the second way is bad.

So. Given you have some concept of the maths:

If you had 200 cards, and needed to display them 15 at a time.
How would you in maths terms work out given page = p, what numbers to show for page p?

LizR 171 Posting Virtuoso

is that the debug value, or the displayed if you print it out value?

LizR 171 Posting Virtuoso

Well if I gave you 40 peies of paper, and told you to show me the first 15, then the second 15, and then said "next" how do you as a person work it out? now tell your computer exactly the same.

LizR 171 Posting Virtuoso

Then its probably true.
Whats in your path?

LizR 171 Posting Virtuoso

Assuming that fs1 and fs2 are streams... go take a look at the helpfile.

LizR 171 Posting Virtuoso

As I said before, work it out on paper, you have a few ways to do it. One is messier to code but easier on the eyes, the other a bit more maths but easier to code.

Either way, its a logic issue not a coding issue, so have a go at working out how you might do it.

If nothing else, start a new console based app, and get it to print numbers 1-15 for page 1, and then move to page 2, and back, and so on. so you can concentrate purely on that aspect.

PS now you started a new thread, and the last question was solved, please mark it as such